Saturday, September 11, 2010

get object qs with generic relation

Dear Django users,

I have a tagging system that uses a GenericForeignKey to assign tags
to generic objects. I would like to write a function that given a
model and a list of tags returns a QuerySet containing all instances
of that model that have been given those tags.

I'm not a huge fan of django-tagging's solution
(get_intersection_by_model):
http://code.google.com/p/django-tagging/source/browse/trunk/tagging/models.py

Any elegant solutions out there?

Thanks for the help, Andrew

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate