Hi,

I have an Event model which can have comments. Comments can be added
to any kind of objects so the Comment model uses a generic relation
via content types.

When displaying a list of events I would like to display the number of
comments for each event. To improve performance and limit the number
of queries I'd like to use the 'extra' queryset modifier, but is that
even possible? The fact that it uses a generic relation means that I
need to know the content type id. If I hardcode that id in the 'extra'
statement then the site cannot reliably be ported to another database.

Can the extra modifier be reliably used with generic relations, or is
there a workaround?

Thanks a lot for your advice.

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