Using south to refactor a Django model with inheritance

后端 未结 4 1911
遇见更好的自我
遇见更好的自我 2020-12-04 07:40

I was wondering if the following migration is possible with Django south and still retain data.

Before:

I currently have two apps, one called tv, one calle

4条回答
  •  心在旅途
    2020-12-04 08:08

    Abstract Model

    class VideoFile(models.Model):
        name = models.CharField(max_length=1024, blank=True)
        size = models.IntegerField(blank=True, null=True)
        ctime = models.DateTimeField(blank=True, null=True)
        class Meta:
            abstract = True
    

    May be generic relation will be useful for you too.

提交回复
热议问题