Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

django datefield year only

import datetime
YEAR_CHOICES = []
for r in range(1980, (datetime.datetime.now().year+1)):
    YEAR_CHOICES.append((r,r))

year = models.IntegerField(_('year'), choices=YEAR_CHOICES, default=datetime.datetime.now().year)
Comment

PREVIOUS NEXT
Code Example
Python :: pyaudio 
Python :: readline python 
Python :: break 
Python :: pygame python 
Python :: how to make one list from nested list 
Python :: pygame buttons 
Python :: matplotlib get padding from bbox 
Python :: pandas sample 
Python :: python while true 
Python :: how to check if a value is nan in python 
Python :: round down decimal python 
Python :: python 3d software 
Python :: anaconda install python 
Python :: python check if character in string 
Python :: installing python 3 to linux 
Python :: sequence in python 
Python :: how to add items in list in python 
Python :: inline for python 
Python :: migration django 
Python :: Simple example of python strip function 
Python :: add key value in each dictonary in the list 
Python :: numpy difference between two arrays 
Python :: django filter on related field 
Python :: Finding the maximum element from a matrix with Python numpy.argmax() 
Python :: python pattern 
Python :: run flask in background 
Python :: opencv rgb to gray custom 
Python :: 2d array python initialize 
Python :: how to convert r to python 
Python :: how to find the summation of all the values in a tuple python 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =