Python django.forms.widgets.DateTimeInput() Examples

The following are 1 code examples of django.forms.widgets.DateTimeInput(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module django.forms.widgets , or try the search function .
Example #1
Source File: datetime.py    From jorvik with GNU General Public License v3.0 5 votes vote down vote up
def add_class_attrs(self, widget=None):
        super(DateTimeFieldRenderer, self).add_class_attrs(widget=widget)
        classes = widget.attrs.get('class', '')

        if isinstance(widget, DateTimeInput):  # Ora e data
            classes = add_css_class(classes, 'selettore-data-ora')

        elif isinstance(widget, DateInput):  # Solo data
            classes = add_css_class(classes, 'selettore-data')

        widget.attrs['class'] = classes