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

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

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -