On 13 nov, 14:53, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am building a custom Manager for adding extra methods that return
> filtered querysets.
> I believe this is a common case for custom Managers.

Yes, indeed.

> Digging into the documentation [1], the only example emphasises on the
> ability to return anything from a Manager method. However, I miss a
> standard example for methods that DO return a filtered queryset.



> I am still struggling with my custom Manager method, which raises an
> error in my project ('NoneType' object has no attribute '_meta'). Any
> hint?

Not without the relevant source code and the full traceback. Sorry, my
crystall ball is out for repair.

> My custom Manager method is like this:
>   def active(self):
>     return self.get_query_set().filter(status=STATUS_ACTIVE)

or more simply:

      return self.filter(status=STATUS_ACTIVE)

But this won't solve your problem anyway.

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to