Fields Clash In Case Of Inheritance
I' ve the following simplified model structure: #common/models.py class CLDate(models.Model): active = models.BooleanField(default=True) last_modified = models.DateTimeFiel
Solution 1:
Since you are using multi-table inheritance, Django creates an implicit one-to-one field from Dokument
to CLDate
. The reverse relation dokument
from CLDate
to Dokument
is clashing with your Entity.dokument
field.
If you don't want to rename your Entity.dokument
field, then your other option is to explicitly define the parent link field from Dokument
to CLDate
and set related_name
.
class Dokument(CLDate):
cl_date = models.OneToOneField(CLDate, parent_link=True, related_name='related_dokument')
user = models.ForeignKey(User)
Post a Comment for "Fields Clash In Case Of Inheritance"