bmeredyk wrote: > I'm just starting out with django and need some help with how to > perform custom queries. The query I want to do is basically this: > > SELECT num_volunteers, num_boxes, (num_boxes * 216) as meals, > (num_boxes/num_volunteers) as box_per_person FROM shifts WHERE site = > %s AND date BETWEEN %s and %s > (...)
well you run this query in python environment so I think that best way would be to make simple chain query without this mathematical operation. e.g. Shifts.objects.filter(site=<site_id>,date__gte=datetime.date(...),date__lte=datetime.date(...)) Regards, Jakub --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---