Answer the question
In order to leave comments, you need to log in
How to design the following query on Django ORM?
Good evening! I would like your help with the following:
There are three models:
class Modal(models.Model):
semething
class Link(models.Model):
active = models.BooleanField(default=True)
next_modal = models.ForeignKey(Modal, blank=True, null=True)
parent_modals = models.ManyToManyField(Modal, through='ModalItem', related_name="child_links")
class ModalItem(models.Model):
modal = models.ForeignKey(Modal)
...
link = models.ForeignKey(Link)
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