hi
In my view I am taking user input string for month( like 'jan','feb')
and want to search the db for objects with those months as published
time.

def entry_archive_for_month(request,year,month):
 
entryset=Entry.objects.filter(pub_time__year=year,pub_time__month=month)


obviously this will cause ValueError since month='jan' but
pub_time__month should be an integer

Is there any way I can convert the month string into integer?Do I have
to create a dictionary with all lowercase month strings and then call
a function to return the matching integer?I would like to know if
there is a better way.

thanks
harry

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