It's easy to fetch extra object attributes with extra(select={...}).
But how can I obtain extra sub-objects (easily, without resorting to
custom SQL)?
I'd like to be able to do something like the following, but obviously
this doesn't work:
extra(select={'country': 'SELECT book_country.name,
book_country.code'})
What works is:
extra(select={'country_name': 'SELECT book_country.name'},
'country_code': 'SELECT book_country.code'})
but when you add the (omitted) FROM and WHERE clause, it's suddenly
quite verbose.
JJ.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---