Open mcallaghan opened 5 years ago
We have a few cases where models have several null fields for a generic relationship to one of several possible specific relations.
E.g. the DocTopic object has a generic "document" that can be either a scoping Doc or a Parliament Paragraph or in future a Twitter Status.
DocTopic
Doc
Paragraph
Status
Perhaps it's better to have an abstract base Doc with some generic features that is then linked to specific doc types
https://django-polymorphic.readthedocs.io/en/stable/
We have a few cases where models have several null fields for a generic relationship to one of several possible specific relations.
E.g. the
DocTopic
object has a generic "document" that can be either a scopingDoc
or a ParliamentParagraph
or in future a TwitterStatus
.Perhaps it's better to have an abstract base
Doc
with some generic features that is then linked to specific doc typeshttps://django-polymorphic.readthedocs.io/en/stable/