I would like to be able to filter a query set based on a calculated date value. Googling did not bring up anything obvious.
As close as I can express it in "pseudo syntax", I'd like to do something along these lines: import datetime from dateutil.relativedelta import * today = datetime.now() MyModel.objects.filter( (my_date_field + relativedelta(months = +my_month_field))__lt = today ) i.e. compare one date with another - the second is calculated using a date field and a second numeric field (value representing months). The above syntax does not work - I am not sure how to code the calculation part... Thanks Derek -- 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.