Value.objects.filter(grouping__build=your_build) I guess You can add it as a method to the Build class
On Wed, Oct 14, 2015 at 6:11 AM, Gergely Polonkai <[email protected]> wrote: > Hello, > > I have three models: > > • Build > • BuildGrouping, with a ForeignKey “build” pointing to Build > • Value, with a ForeignKey “grouping” that points to BuildGrouping > > Right now, I also have Value.build, which is a ForeignKey to Build, so I > can access the list of Values directly from a Build. > > This setup, though, doesn’t feel right, as it contains redundancy. Is > there a way to access the list of Values directly from Build without having > this redundancy? > > Thank you in advance! > > Best, > Gergely > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CACczBU%2BCCSPDbH6Q%2Bn-n9r0kQjYHKrAMQgVWd6mFPjLfZhoULg%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CACczBU%2BCCSPDbH6Q%2Bn-n9r0kQjYHKrAMQgVWd6mFPjLfZhoULg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALn3ei1YKx1KPbcVJXQOfT034%3Dr5A0Lc9AO7ifq5cBb2eS%3D_yA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

