Django 继承的抽象模型,无法保存foreignKey字段

Django 继承的抽象模型,无法保存foreignKey字段,django,inheritance,foreign-keys,Django,Inheritance,Foreign Keys,在Django应用程序中,我有以下模型: class DLL(models.Model): prev = models.ForeignKey('self', related_name = 'prevItem', blank = True, null = True) next = models.ForeignKey('self', related_name = 'nextItem', blank = True, null = True) class Meta: abstract = Tr

在Django应用程序中,我有以下模型:

class DLL(models.Model):
prev = models.ForeignKey('self', related_name = 'prevItem', blank = True, null = True)
next = models.ForeignKey('self', related_name = 'nextItem', blank = True, null = True)

class Meta:
    abstract = True
类SomeDataDLL: name=models.TextField

问题是,当我将一个SomeData对象的next或prev设置为另一个SomeData对象时,既不保存prev也不保存next

例如:

s1 = SomeData(name='one')
s2 = SomeData(name='two')
s2.save()
s1.next = s2
s1.save()

s = SomeData.objects.get(pk=2)
#now s is = s1
s.next
#is None

对不起,这个很好用。这项工程一定有什么奇怪的问题。
已解决。

我们的想法是让多个模型扩展DLL类,这样我就不能只有一些数据的外键。