Re: filter date in view.py

2009-05-30 Thread Jesse
Hello Derek, The grantstartdt field has a date format, the Year field (drop down) is a list of years in format, but the field is character. I need to parse the from the date field to match the of the Year value. When I changed the code as you suggested I received this error: da

Re: filter date in view.py

2009-05-29 Thread Derek Willis
When you use grantstartdt__year in your filter, it's looking for an integer, not an instance of your Year model, which is what you have in your view. So, assuming the pk attribute in Year is an integer, you'd change your line to something like this: projectyr=Researchproject.objects.exclude(activ

filter date in view.py

2009-05-29 Thread Jesse
Hello, year_id (2004 etc) is a dropdown box on the template. The users selects a year and this is retrieved as year_id in the view. I need to select publications based on year from a field called grantstartdt which is in the format 2008-01-01. The error is: int() argument must be a string or