Ok thanks but I ran into some other problem.
I have company1 with 3 callreports with dates -> 20 Nov, 25 Nov, 28
Nov
company 2 with callreports dates -> 10 Nov, 13 nov.
so my problem here is when I do :
company_list = Company.objects.select_related().order_by('-
callreports__meetingdate')
gives me the correct company list.
but when I do company_list = Company.objects.select_related().order_by
('callreports__meetingdate')
It should give me list in ascending order but it does not.
it sort the list by first callreports date not by the latest date.
thanks.
On Nov 25, 1:22 pm, Andy Young <[EMAIL PROTECTED]> wrote:
> On Nov 25, 12:27 am,laspal<[EMAIL PROTECTED]> wrote:
>
> > Exception Type: FieldError
> > Exception Value: Cannot resolve keyword 'callreports_meetingdate'
> > into field.
>
> Your error indicates a missing model field named
> 'callreports_meetingdate' since you used a single underscore.
>
> Use a double underscore for field lookup (there are two squeezed in
> between there):
>
> > > sortby = callreports__meetingdate
>
> Cheers.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---