Excellent,
Thanks very much
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/VfjSLhXCkPcJ.
To post to this group, send email to django-users@googlegroups.co
I was in the same situation as you and I found this solution...
in your models.py:
import datetime
YEAR_CHOICES = []for r in range(1980,
(datetime.datetime.now().year+1)):YEAR_CHOICES.append((r,r))
so, your field can now use YEAR_CHOICES:
year = models.IntegerField(_('year'), max_length=4,
2 matches
Mail list logo