Ticket #4428: widgets.diff
File widgets.diff, 1004 bytes (added by , 17 years ago) |
---|
-
widgets.py
15 15 from util import flatatt 16 16 17 17 __all__ = ( 18 'Widget', 'TextInput', ' PasswordInput',18 'Widget', 'TextInput', 'DateTimeInput', 'PasswordInput', 19 19 'HiddenInput', 'MultipleHiddenInput', 20 20 'FileInput', 'Textarea', 'CheckboxInput', 21 21 'Select', 'NullBooleanSelect', 'SelectMultiple', 'RadioSelect', … … 83 83 class TextInput(Input): 84 84 input_type = 'text' 85 85 86 class DateTimeInput(Input): 87 input_type = 'text' 88 89 def __init__(self, attrs=None, format=None): 90 self.attrs = attrs or {} 91 self.format = format or settings.DATETIME_FORMAT 92 93 def render(self, name, value, attrs=None): 94 from django.utils.dateformat import format 95 return super(DateTimeInput, self).render(name, format(value, self.format), attrs) 96 86 97 class PasswordInput(Input): 87 98 input_type = 'password' 88 99