Re: Alter the list of fields returned by a queryset without turning them into strings?

2011-09-13 Thread Joshua Russo
I had previously typed (but obviously not sent) a thank you ... so, thank you. That was what I was looking for and did lead me to my ultimate solution. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

Re: Alter the list of fields returned by a queryset without turning them into strings?

2011-09-13 Thread Joshua Russo
So, how I actually solved it was even a bit different: Document.objects.filter(documentType=1, event__eventType=1).annotate(Max('event__start_date')).order_by('event__start_date__max') I had to use the Max function because the relationship is actually a many to many. Even if it was just a

Re: Alter the list of fields returned by a queryset without turning them into strings?

2011-09-12 Thread Jacob Kaplan-Moss
On Mon, Sep 12, 2011 at 8:41 PM, Joshua Russo wrote: > Do I just need to do a little more pre-processing in the view or can I > accomplish what I'm trying to do? The method you're looking for is ``only()`` (or perhaps its cousin, ``defer``):

Alter the list of fields returned by a queryset without turning them into strings?

2011-09-12 Thread Joshua Russo
I have 2 tables, document and event. I want to retrieve the document url and the event date but it seems like I can't do this in a single query set and that is then used directly in a template. This was my first thought: context = { 'minutes': Document.objects.filter(documentType=1,