class Meta: model = SectionManagementModel fields = ['title', 'description', 'background_color', 'image1'] widgets = { 'background_color': HTML5Input(input_type='color', attrs={'size': 10}), }
class Meta: model = VerifyCode widgets = { 'created': SuitSplitDateTimeWidget, 'mobile': HTML5Input(input_type='number'), } exclude = ('status_changed', 'code')
class Meta: model = SectionManagementModel fields = [ 'title', 'section_sub_title', 'description', 'background_color', 'image1', 'image2', 'image3', 'image4', 'image5' ] widgets = { 'background_color': HTML5Input(input_type='color'), }
class GooogleCalendarInline(TabularInline): model = GoogleCalendar fields = ('url', 'updated', 'found_events') readonly_fields = ('updated', 'found_events') extra = 1 formfield_overrides = { models.URLField: { 'widget': HTML5Input(input_type='url', attrs={'placeholder': 'Private Google calendar URL'}) }, } def updated(self, instance): return self._datetime(instance.last_update) def found_events(self, instance): return ExternalEvent.objects.by_src(instance).count() class Media: css = { 'all': ('admin/calendar_admin.css', ), }
def __init__(self, attrs=None): widgets = (HTML5Input(input_type='date', ), HTML5Input(input_type='time')) forms.MultiWidget.__init__(self, widgets, attrs)
def test_HTML5Input(self): input_type = 'calendar' inp = HTML5Input(input_type=input_type) self.assertEqual(input_type, inp.input_type)
def __init__(self, attrs=None): subwidgets = (SuitDateWidget(attrs=attrs), HTML5Input(attrs={'class': 'input-small'}, input_type='time')) forms.MultiWidget.__init__(self, subwidgets, attrs)
class Meta: model = SectionManagementModel fields = ['title', 'background_color'] widgets = { 'background_color': HTML5Input(input_type='color'), }