On Thu, Jun 4, 2009 at 11:41 PM, Streamweaver<streamwea...@gmail.com> wrote: > > I'm still struggling a bit with related managers. I have what I think > should work right by the documentation but behavior isn't as expect. > > [...] > > I have a Project model which has Releases so Releases have a FK field > for Projects. I want to be able to get Releses with particular > combinations of settings so I created a custom manager for releases. > It returns the values I want just fine. > > My problem is with related sets of releases called from a Project. > I've used the 'use_for_related_fields' flag as per the official docs > but if I have a Project p and call p.release_set.in_development() for > instance, it gives me all Releases in the DB with those flags instead > of just the ones related to the instance in p.
But documentation doesn't say nor imply that there will be any automatic (magic?) per-Project filtering of Release querysets generated by your manager just because you have set its use_for_related_fields to True. Even further, it recommends against returning filtered querysets whe use_for_related_fields=True. -- Ramiro Morales http://rmorales.net --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---