I have a model for categories that contains a circular foreign key. I dumped all the data from this model, and I created data migration using django-south to load it into another DBMS, but I have a lot of problems with this because of this circular dependency.
This is the model I'm talking about:
class Category(MPTTModel): name = models.CharField(_('name'), max_length=50, unique=True) parent = models.ForeignKey('self', null=True, blank=True, related_name='categories') description = models.TextField(_('description'), blank=True, null=True) created_on = models.DateTimeField(auto_now_add = True, default=date.today()) updated_on = models.DateTimeField(auto_now = True, default=date.today()) def __unicode__(self): return "%s" %(self.name) class Meta: verbose_name = _('category') verbose_name_plural= _('categories')
source share