Hello,

Do I need t convert the value returned from Max() to an int, or am I
using it incorrectly? I'm getting this template error:

Caught an exception while rendering: (1064, "You have an error in your
SQL syntax; check the manual that corresponds to your MySQL server
version for the right syntax to use near ''id__max': '2'} )' at line
1")
1

from django.db.models import Max

def preview(request, template_name='listings/preview.html',
order_num=Order.objects.aggregate(Max('id'))):
    num = order_num
    user = request.user
    listings = Listing.objects.filter
(order__customer__user__username=user)
    gallery = Photo.objects.filter
(order__customer__user__username=user, order=num)
    return render_to_response(template_name, { 'user': user,
'listings': listings, 'order': num, 'gallery': gallery })


Thanks,

Jason
--~--~---------~--~----~------------~-------~--~----~
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 
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