django - Adding custom attrs to a form widget -


i'm working forms in django, , need add custom attribute widgets, example:

    widgets = {         'datefield': forms.widgets.dateinput(attrs = {'myownattr': 'foobar_value'})     } 

is valid? , if it, how can access template? tried {{ field.myownattr }}, doesn't return @ all.


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

ios - MKAnnotationView layer is not of expected type: MKLayer -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -