Exemplo n.º 1
0
 class Meta:
     model = SectionManagementModel
     fields = ['title', 'description', 'background_color', 'image1']
     widgets = {
         'background_color': HTML5Input(input_type='color',
                                        attrs={'size': 10}),
     }
Exemplo n.º 2
0
 class Meta:
     model = VerifyCode
     widgets = {
         'created': SuitSplitDateTimeWidget,
         'mobile': HTML5Input(input_type='number'),
     }
     exclude = ('status_changed', 'code')
Exemplo n.º 3
0
 class Meta:
     model = SectionManagementModel
     fields = [
         'title', 'section_sub_title', 'description', 'background_color',
         'image1', 'image2', 'image3', 'image4', 'image5'
     ]
     widgets = {
         'background_color': HTML5Input(input_type='color'),
     }
Exemplo n.º 4
0
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', ),
        }
Exemplo n.º 5
0
 def __init__(self, attrs=None):
     widgets = (HTML5Input(input_type='date', ), HTML5Input(input_type='time'))
     forms.MultiWidget.__init__(self, widgets, attrs)
Exemplo n.º 6
0
 def test_HTML5Input(self):
     input_type = 'calendar'
     inp = HTML5Input(input_type=input_type)
     self.assertEqual(input_type, inp.input_type)
Exemplo n.º 7
0
 def __init__(self, attrs=None):
     subwidgets = (SuitDateWidget(attrs=attrs),
                   HTML5Input(attrs={'class': 'input-small'},
                              input_type='time'))
     forms.MultiWidget.__init__(self, subwidgets, attrs)
Exemplo n.º 8
0
 class Meta:
     model = SectionManagementModel
     fields = ['title', 'background_color']
     widgets = {
         'background_color': HTML5Input(input_type='color'),
     }