Re: Complex query
On Monday, September 9, 2013 12:13:09 AM UTC+3, Yegor Roganov wrote:
This is something that would be nice to support with prefetch_related(). This is exactly the type of query where ORM abstraction would be very welcome. Writing this in SQL isn't easy, and the most efficient way to write the query varies a lot depending on the used database backend.
Unfortunately I don't see other solutions than running multiple queries or using raw SQL.
- Anssi
-- I found out this is a so called "top n per group" problem and it's not that easy to implement in django. Maybe someone could help me to find another way (for example, alter the schema in some way)?
This is something that would be nice to support with prefetch_related(). This is exactly the type of query where ORM abstraction would be very welcome. Writing this in SQL isn't easy, and the most efficient way to write the query varies a lot depending on the used database backend.
Unfortunately I don't see other solutions than running multiple queries or using raw SQL.
- Anssi
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home