On Mon, Feb 15, 2010 at 1:43 PM, Greg Brown <gregplaysgui...@gmail.com> wrote:
> The queryset giving the problem is
>
> UserProfile.objects.values(
>        'ird_number', 'user__first_name', 'user__last_name', 'user__pk',
>    ).annotate(
>        Max('user__application__creation_date'),
>    ).order_by('-user__application__creation_date__max')


It looks to me like you are trying to get more info from the User
model then then UserProfile model, so maybe change your query to be
based on the User not the UserProfile


User.objects.values('first_name', 'last_name', 'pk').annotate(
    Max('application__creation_date'),
).order_by('-application__creation_date__max').select_related()

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to