Django migration Fehler :Sie können nicht ändern oder von M2M-Felder, oder hinzufügen oder entfernen von durch= auf M2M-Felder

Ich versuche zu ändern, eine M2M-Bereich ein ForeignKey-Feld. Der Befehl validieren zeigt mir keine Probleme und wenn ich laufen syncdb :

ValueError: Cannot alter field xxx into yyy they are not compatible types (you cannot alter to or from M2M fields, or add or remove through= on M2M fields)

So, ich kann nicht die migration.

class InstituteStaff(Person):
    user                 = models.OneToOneField(User, blank=True, null=True)
    investigation_area   = models.ManyToManyField(InvestigationArea, blank=True,)
    investigation_group  = models.ManyToManyField(InvestigationGroup, blank=True)
    council_group        = models.ForeignKey(CouncilGroup, null=True, blank=True)
    #profiles            = models.ManyToManyField(Profiles, null = True, blank = True)
    profiles             = models.ForeignKey(Profiles, null = True, blank = True)

Dies ist mein erstes Django-Projekt, damit alle Vorschläge sind willkommen.

  • Ich hasse dieses problem.
InformationsquelleAutor loar | 2014-11-14
Schreibe einen Kommentar