How can I provide a queryset field for a subclass of a one-to-many relation in Django?
Example:
class Concept(models.Model): ... class StudyResource(models.Model): concept = models.ForeignKey(Concept, on_delete=models.CASCADE) ... class VideoStudyResource(StudyResource): ...
Django provides:
concept.studyresource_set.all()
how can I also provide:
concept.videostudyresource_set.all()
Appreciate any suggestions.
One-To-Many
ForeignKey
Concept
VideoStudyResource
1.4m articles
1.4m replys
5 comments
57.0k users