我的模型:
Class A(Orderable, Slugged):
a = models.CharField(max_length=250, null=True, blank=True)
class Meta:
ordering = ("_order",)
Class B(Orderable, Slugged):
a = models.ForeignKey(A, null=True, blank=True)
b = models.CharField(max_length=250, null=True, blank=True)
class Meta:
ordering = ("_order",)
order_with_respect_to = "a"
Class C(Orderable, Slugged):
b = models.ForeignKey(B, null=True, blank=True)
c = models.CharField(max_length=250, null=True, blank=True)
class Meta:
ordering = ("_order",)
order_with_respect_to = "b__a"
我怎样才能做到这一点? 我要“C”级秩序,尊重“A”级。 我们将不胜感激。你知道吗
您可以尝试从
A.Meta
继承C.Meta
:相关问题 更多 >
编程相关推荐