Answer the question
In order to leave comments, you need to log in
How to get all fields of related models cascading?
Lord comrades! Tell me, is there any elegant way to make a request to the database?
class Projects(models.Model):
name = models.CharField(max_length=32, default=None, null=True, verbose_name="Название")
class Clusters(models.Model):
project = models.ForeignKey(Projects, null=True, on_delete=models.CASCADE)
class Accounts(models.Model):
clusters = models.ForeignKey(Clusters, null=True, on_delete=models.SET_NULL)
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