month_ids is a list of months like this... [('Apr07', 'April 2007'), ('Mar07', 'March 2007'), ('Feb07', 'February 2007')]
which can be used in a select box like this..
month = forms.ChoiceField(choices=(months))
1 2 3 4 5 6 7 8 9 10 11 | from mx.DateTime import *
from datetime import datetime
date = now()
month_ids = []
while not (date.month == 4 and date.year == 2004):
month_ids.append((date.strftime('%b%y'),date.strftime('%B %Y')))
date = date + RelativeDateTime(months=-1)
print month_ids
#date.days_in_month
|
More like this
- Mask sensitive data from logger by agusmakmun 1 week, 4 days ago
- Template tag - list punctuation for a list of items by shapiromatron 1 year, 2 months ago
- JSONRequestMiddleware adds a .json() method to your HttpRequests by cdcarter 1 year, 2 months ago
- Serializer factory with Django Rest Framework by julio 1 year, 9 months ago
- Image compression before saving the new model / work with JPG, PNG by Schleidens 1 year, 10 months ago
Comments
Please login first before commenting.