Well, this is useful in the case where you have multiple custom
managers
defined on a model and you need to a select a specific manager. Doing
so,
 common filter operations that are long expressions or are quite
complicated,
 need not be repeated every time.

On Oct 4, 9:40 am, Tai Lee <[email protected]> wrote:
> Your custom manager could do nothing to filter results by default and
> so behave the same as the default automatic manager, but provide
> additional methods that filter the results as you need.

If the get_query_set() method of a manager is overridden, the
filtering
behavior can actually be changed. In the tests there is an example
does this.

>
> Cheers.
> Tai.
>
> On Oct 3, 3:25 pm, Vivek Narayanan <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > I've added a patch that provides functionality for selecting a custom
> > manager in a reverse relation , rather than the default manager. For
> > example:
>
> >          author = Author.objects.get(id=1)
> >          # Selects the manager 'foobar' of Post.
> >          mgr = author.post_set.managers("foobar")
>
> >https://code.djangoproject.com/ticket/3871
>
> > Would be great if someone could review it.
>
> > Vivek

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to