Answer the question
In order to leave comments, you need to log in
How to use ForeignKey with abstract base class in django?
I want this:
class A(models.Model):
class Meta:
abstract = True
class B(A):
pass
class C(A):
pass
class D(models.Model):
a = models.ForeignKey(A)
def is_b(self):
return if isinstance(self.a, b):
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question