Hi,

I have a custom manager for a Tag model and I want to apply its
methods also to Tag querysets, not just to "Tag.objects".

There has been a discussion on this here:
http://groups.google.com/group/django-users/browse_thread/thread/3d00660409d277da/

but what Malcolm suggested is not very clear to me. I think I get it
wrong, but here is what I've tried:

class TagQuerySet(models.query.Query):
    model = Tag

class TagManager(models.Manager)
    # ...
    def get_query_set(self):
        return TagQuerySet

    def my_filter(self):
        # calculate the query set
        # ...
        return get_query_set().my_filter(*args, **kwargs)


I doubt that this will work, but in the first place I have a circular
reference problem while importing. TagQuery class needs Tag to be
defined, Tag needs TagManager to be defined and TagManager needs
TagQuery to be defined.

Thanks for any help...
oMat


--~--~---------~--~----~------------~-------~--~----~
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