<div dir="ltr">Ho un simpatico side effects, eseguendo una makemigrations (a meno che non abbia la cartella migrations vuota, ma in tal caso provvede gentilmente la successiva migrate a dare il side effect) ottengo un messaggio come questo <div><br></div><div><div>(server)globex@Globex:~/server/globextest$ ./manage.py migrate</div><div>Operations to perform:</div><div> Synchronize unmigrated apps: apis_manage, socials_manage, users_manage, data_filler, statistics_manage, recensioni_manage, corsheaders</div><div> Apply all migrations: messages_manage, hosters_manage, sessions, admin, auth, contenttypes, push_notifications, routers_manage</div><div>Synchronizing apps without migrations:</div><div> Creating tables...</div><div> Installing custom SQL...</div><div> Installing indexes...</div><div>Running migrations:</div><div> No migrations to apply.</div><div>Traceback (most recent call last):</div><div> File "./manage.py", line 10, in <module></div><div> execute_from_command_line(sys.argv)</div><div> File "/home/globex/server/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line</div><div> utility.execute()</div><div> File "/home/globex/server/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute</div><div> self.fetch_command(subcommand).run_from_argv(self.argv)</div><div> File "/home/globex/server/local/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv</div><div> self.execute(*args, **options.__dict__)</div><div> File "/home/globex/server/local/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute</div><div> output = self.handle(*args, **options)</div><div> File "/home/globex/server/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 153, in handle</div><div> executor.loader.project_state(),</div><div> File "/home/globex/server/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 272, in project_state</div><div> return self.graph.make_state(nodes=nodes, at_end=at_end, real_apps=list(self.unmigrated_apps))</div><div> File "/home/globex/server/local/lib/python2.7/site-packages/django/db/migrations/graph.py", line 158, in make_state</div><div> for migration in self.forwards_plan(node):</div><div> File "/home/globex/server/local/lib/python2.7/site-packages/django/db/migrations/graph.py", line 60, in forwards_plan</div><div> return self.dfs(node, lambda x: self.dependencies.get(x, set()))</div><div> File "/home/globex/server/local/lib/python2.7/site-packages/django/db/migrations/graph.py", line 124, in dfs</div><div> self.ensure_not_cyclic(start, get_children)</div><div> File "/home/globex/server/local/lib/python2.7/site-packages/django/db/migrations/graph.py", line 112, in ensure_not_cyclic</div><div> raise CircularDependencyError(", ".join("%s.%s" % n for n in cycle))</div><div>django.db.migrations.graph.CircularDependencyError: hosters_manage.0002_auto_20150609_0820, hosters_manage.0001_initial, messages_manage.0001_initial</div></div><div><br></div><div>I models coinvolti sono i seguenti</div><div><br></div><div>users_manage - models.py</div><div><br></div><div><div>from django.db import models</div><div><br></div><div>#from hosters_manage.models import Hosters, HostersAddress</div><div><br></div><div># Create your models here.</div><div><br></div><div>class FirstName(models.Model):</div><div><span class="" style="white-space:pre"> </span>first_name = models.CharField(max_length=100)</div><div><br></div><div><br></div><div>#class Invitation(models.Model):</div><div>#<span class="" style="white-space:pre"> </span>inviting = models.ForeignKey("Users", related_name='invitante')</div><div>#<span class="" style="white-space:pre"> </span>invited = models.ForeignKey("Users", related_name='invitato')</div><div><br></div><div><br></div><div>class LastName(models.Model):</div><div><span class="" style="white-space:pre"> </span>last_name = models.CharField(max_length=100)</div><div><br></div><div><br></div><div>class Users (models.Model):</div><div><span class="" style="white-space:pre"> </span>email = models.EmailField()</div><div><span class="" style="white-space:pre"> </span>password = models.CharField(max_length=100)</div><div><span class="" style="white-space:pre"> </span>mac_address = models.CharField(max_length=100)</div><div><span class="" style="white-space:pre"> </span>uuid = models.CharField(max_length=100)</div><div><span class="" style="white-space:pre"> </span>telefono = models.CharField(max_length=30)</div><div><span class="" style="white-space:pre"> </span>active = models.BooleanField(default=False)</div><div><span class="" style="white-space:pre"> </span>deleted = models.BooleanField(default=False)</div><div><br></div><div><br></div><div>class UsersData(models.Model):</div><div><span class="" style="white-space:pre"> </span>USER_TYPES = (</div><div><span class="" style="white-space:pre"> </span>('1','Normale'),</div><div><span class="" style="white-space:pre"> </span>('1','Pro'),</div><div><span class="" style="white-space:pre"> </span>('1','Super'),</div><div><span class="" style="white-space:pre"> </span>('1','Mega'),</div><div><span class="" style="white-space:pre"> </span>)</div><div><br></div><div><span class="" style="white-space:pre"> </span>users_id = models.ForeignKey("Users")</div><div><span class="" style="white-space:pre"> </span>nome = models.CharField(max_length=100)</div><div><span class="" style="white-space:pre"> </span>cognome = models.CharField(max_length=100)</div><div><span class="" style="white-space:pre"> </span>nickname = models.CharField(max_length=100)</div><div><span class="" style="white-space:pre"> </span>avatar = models.CharField(max_length=300)</div><div><span class="" style="white-space:pre"> </span>data_nascita = models.DateField()</div><div><span class="" style="white-space:pre"> </span>sesso = models.CharField(max_length=1)</div><div><span class="" style="white-space:pre"> </span>eta = models.IntegerField()</div><div><span class="" style="white-space:pre"> </span>latitudine = models.FloatField(default=0.0,blank=True,null=True)</div><div><span class="" style="white-space:pre"> </span>longitudine = models.FloatField(default=0.0,blank=True,null=True)</div><div><span class="" style="white-space:pre"> </span>codice = models.CharField(max_length=10)</div><div><span class="" style="white-space:pre"> </span>conto = models.FloatField(default=2.0,blank=True,null=True)</div><div><span class="" style="white-space:pre"> </span>activation_data = models.DateTimeField(auto_now_add=True,null=True,blank=True)</div><div><span class="" style="white-space:pre"> </span>tipo_utente = models.CharField(max_length=1,choices=USER_TYPES)</div><div><span class="" style="white-space:pre"> </span>#registrar = models.ForeignKey("hosters_manage.HostersAddress",null=True,blank=True)</div><div><span class="" style="white-space:pre"> </span>changed = models.BooleanField(default=False)</div><div><span class="" style="white-space:pre"> </span>conto_paypal = models.TextField()</div><div><span class="" style="white-space:pre"> </span>device = models.CharField(max_length=100,null=True, blank=True)</div><div><span class="" style="white-space:pre"> </span>platform = models.CharField(max_length=100,null=True, blank=True)</div><div><span class="" style="white-space:pre"> </span>version = models.CharField(max_length=100,null=True, blank=True)</div><div><span class="" style="white-space:pre"> </span>last_lat = models.FloatField(null=True, blank=True)</div><div><span class="" style="white-space:pre"> </span>last_lng = models.FloatField(null=True, blank=True)</div><div><span class="" style="white-space:pre"> </span>invited_by = models.ForeignKey("Users",null=True,blank=True, related_name='invitato_da')</div><div><span class="" style="white-space:pre"> </span>token = models.CharField(max_length=300)</div></div><div><br></div><div>hosters_manage - models.py</div><div><br></div><div><div>from django.db import models</div><div>from jsonfield import JSONField</div><div><br></div><div>#from statistics_manage.models import Categories</div><div>#from messages_manage.models import HostersMessages</div><div>#from users_manage.models import Users</div><div><br></div><div># Create your models here.</div><div><br></div><div>class Hosters(models.Model):</div><div><span class="" style="white-space:pre"> </span>ragione_sociale = models.CharField(max_length=100) #,unique=True)</div><div><span class="" style="white-space:pre"> </span>categories = models.ForeignKey("statistics_manage.Categories", default=0, null=True, blank=True)</div><div><span class="" style="white-space:pre"> </span>active = models.BooleanField(default=False)</div><div><span class="" style="white-space:pre"> </span>deleted = models.BooleanField(default=False)</div><div><br></div><div><br></div><div>class HostersAddress(models.Model):</div><div><span class="" style="white-space:pre"> </span>hoster = models.ForeignKey("Hosters")</div><div><span class="" style="white-space:pre"> </span>logo = models.CharField(max_length=300,blank=True,null=True)</div><div><span class="" style="white-space:pre"> </span>indirizzo = models.CharField(max_length=100, default='')</div><div><span class="" style="white-space:pre"> </span>cap = models.CharField(max_length=10, default='')</div><div><span class="" style="white-space:pre"> </span>localita = models.CharField(max_length=100, default='')</div><div><span class="" style="white-space:pre"> </span>provincia = models.CharField(max_length=10, default='')</div><div><span class="" style="white-space:pre"> </span>telefono = models.CharField(max_length=30, null=True, blank=True)</div><div><span class="" style="white-space:pre"> </span>fax = models.CharField(max_length=30, null=True, blank=True)</div><div><span class="" style="white-space:pre"> </span>email = models.CharField(max_length=100, null=True, blank=True)</div><div><span class="" style="white-space:pre"> </span>descrizione = models.TextField(null=True,blank=True)</div><div><span class="" style="white-space:pre"> </span>latitudine = models.FloatField(default=0.0)</div><div><span class="" style="white-space:pre"> </span>longitudine = models.FloatField(default=0.0)</div><div><span class="" style="white-space:pre"> </span>primary = models.NullBooleanField(default=True, null=True, blank=True)</div><div><span class="" style="white-space:pre"> </span>wifi_quality = models.IntegerField(default=1)</div><div><span class="" style="white-space:pre"> </span>link_fb = models.CharField(max_length=300,null=True,blank=True)</div><div><span class="" style="white-space:pre"> </span>rating = models.FloatField(default=0.0)</div><div><span class="" style="white-space:pre"> </span>active = models.NullBooleanField(default=False, null=True, blank=True)</div><div><span class="" style="white-space:pre"> </span>deleted = models.NullBooleanField(default=False, null=True, blank=True)</div><div><span class="" style="white-space:pre"> </span>user_attorney = models.ForeignKey("users_manage.Users", null=True, blank=True, related_name="user_attorney")</div><div><br></div><div><span class="" style="white-space:pre"> </span>class Meta:</div><div><br></div><div><span class="" style="white-space:pre"> </span>unique_together = (('hoster', 'indirizzo','cap','localita','provincia'),)</div><div><br></div><div><br></div><div>class HostersAddressMedia(models.Model):</div><div><span class="" style="white-space:pre"> </span>MEDIA_TYPES = (</div><div><span class="" style="white-space:pre"> </span>('1', 'FOTO'),</div><div><span class="" style="white-space:pre"> </span>('2', 'VIDEO'),</div><div><span class="" style="white-space:pre"> </span>('3', 'AUDIO'),</div><div><span class="" style="white-space:pre"> </span>)</div><div><span class="" style="white-space:pre"> </span></div><div><span class="" style="white-space:pre"> </span>hoster_address = models.ForeignKey("HostersAddress")</div><div><span class="" style="white-space:pre"> </span>tipo = models.CharField(max_length=1, choices=MEDIA_TYPES)</div><div><span class="" style="white-space:pre"> </span>media = JSONField()</div><div><span class="" style="white-space:pre"> </span>pubblicato = models.BooleanField(default=True)</div><div><br></div><div><br></div><div>class UsersHosters(models.Model):</div><div><span class="" style="white-space:pre"> </span>user = models.ForeignKey("users_manage.Users")</div><div><span class="" style="white-space:pre"> </span>hoster = models.ForeignKey("messages_manage.HostersMessages")</div><div><span class="" style="white-space:pre"> </span>preferred = models.BooleanField(default=False)</div><div><br></div><div><span class="" style="white-space:pre"> </span>class Meta:</div><div><span class="" style="white-space:pre"> </span>unique_together = (('user', 'hoster'),)</div></div><div><br clear="all"><div><br></div><div>Ho provato di ogni da googolare a dare testate sul muro (non la mia di testa ovviamente) ma senza risultato. </div><div><br></div><div>La versione django e' la 1.7.6 final 0</div><div><br></div><div>Sugerimenti?</div><div><br></div><div>Gracias </div><div>Carlos</div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">EZLN ... Para Todos Todo ... Nada para nosotros<br></div></div></div></div>
</div></div>