Exemplo n.º 1
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.fields['page_chooser'].widget = AdminPageChooser()
     self.fields['image_chooser'].widget = AdminImageChooser()
     self.fields['document_chooser'].widget = AdminDocumentChooser()
     self.fields['snippet_chooser'].widget = AdminSnippetChooser(Page)
     self.fields['date'].widget = AdminDateInput()
     self.fields['time'].widget = AdminTimeInput()
     self.fields['datetime'].widget = AdminDateTimeInput()
     self.fields['auto_height_text'].widget = AdminAutoHeightTextInput()
     self.fields['default_rich_text'].widget = get_rich_text_editor_widget('default')
Exemplo n.º 2
0
 def __init__(self, *args, **kwargs):
     super().__init__(*args, **kwargs)
     self.fields["page_chooser"].widget = AdminPageChooser()
     self.fields["image_chooser"].widget = AdminImageChooser()
     self.fields["document_chooser"].widget = AdminDocumentChooser()
     self.fields["snippet_chooser"].widget = AdminSnippetChooser(Page)
     self.fields["date"].widget = AdminDateInput()
     self.fields["time"].widget = AdminTimeInput()
     self.fields["datetime"].widget = AdminDateTimeInput()
     self.fields["auto_height_text"].widget = AdminAutoHeightTextInput()
     self.fields["default_rich_text"].widget = get_rich_text_editor_widget(
         "default")
     self.fields["switch"].widget = SwitchInput()
     self.fields["disabled_switch"].widget = SwitchInput(
         attrs={"disabled": True})
Exemplo n.º 3
0
 def setUp(self):
     self.newTime = AdminTimeInput().attrs.get('autocomplete', "new-time")
Exemplo n.º 4
0
    def field(self):
        from wagtail.admin.widgets import AdminTimeInput

        field_kwargs = {"widget": AdminTimeInput(format=self.format)}
        field_kwargs.update(self.field_options)
        return forms.TimeField(**field_kwargs)
Exemplo n.º 5
0
class EmergencyPowerNotificationForm(forms.Form):
    date = forms.DateField(widget=AdminDateInput())
    start = forms.TimeField(widget=AdminTimeInput())
    end = forms.TimeField(widget=AdminTimeInput())
Exemplo n.º 6
0
class AlarmNotificationForm(forms.Form):
    date = forms.DateField(widget=AdminDateInput())
    start = forms.TimeField(widget=AdminTimeInput())
    end = forms.TimeField(widget=AdminTimeInput())