django - How to pass attrs to forms.DateField? -


in forms.py have this:

date_of_birth = forms.datefield(widget=extras.selectdatewidget( years=range(datetime.date.today().year - 15, 1920, -1))) 

to create select. want pass it, attrs={'class': 'form-control'} tried in different ways no results.

that kind of information gets passed widgets:

date_of_birth = forms.datefield(     widget=extras.selectdatewidget(         years=range(datetime.date.today().year - 15, 1920, -1),         attrs={'class': 'form-control',}     ) ) 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -