I have the following data structure
class A(models.Model):
a number of fields here
class AbstractParent(models.Model):
some fields here
class Meta:
abstract = True
class B(AbstractParent):
a = ForeignKey(A, null=True,default=None, blank=True, on_delete=models.SET_NULL)
I would expect to access the object of B class that fk to an instance of A a
via a.b_set
or a.bs_set
however I only get the error that attribute b_set
does not exist for a
. Any ideas why this is possible and how to access b
that references a
via a
itself?