On Fri, Oct 31, 2008 at 5:08 AM, Tonne <[EMAIL PROTECTED]> wrote: > > So, what I've done is use Model.objects.values() to limit the returned > values, which is not ideal as I'm losing the objectness of the > queryset. > > I've worked around the loss Queryset.get_absolute_url by using a less > than elegant semi-hardcoded url. > > So if I'm missing a blindingly obvious way of limiting a query to > nominated fields so that I can still keep the benefits of a queryset, > please let me know.
You are right about not having the full functionality of the objects and I don't know about a way to keep it while restricting the fields retrieved by the query. > Also, is using Model.objects.values() to limit the fields returned > actually more efficient than Model.objects.all() in terms of database > hits? Not in terms of database hits, but yes in terms of the "size" of the retrieved data. If you are avoiding a lot of fields the difference in traffic size from the database can be big. Regards. -- Marcelo Ramos --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---