Пример #1
0
class HolidayAdmin(admin.ModelAdmin):
    list_display = ('id', 'name', 'dates')
    inlines = (HolidayMovedInline, )
    formfield_overrides = {
        DateRangeField: {
            'widget': RangeWidget(AdminDateWidget())
        },
    }
Пример #2
0
 class Meta:
     model = AdditionalAgreement
     fields = ('cinema', 'contract', 'film', 'active_date_range',
               'dimension', 'is_original_language', 'vat', 'one_c_number')
     widgets = {
         'active_date_range':
         RangeWidget(base_widget=AdminDateWidget()),
         'cinema':
         autocomplete.ModelSelect2(url='all_cinemas_autocomplete'),
         'contract':
         autocomplete.ModelSelect2(url='general_contact_autocomplete'),
         'film':
         autocomplete.ModelSelect2(url='film_autocomplete'),
     }
Пример #3
0
 class Meta:
     model = VolunteerSlot
     exclude = []
     widgets = {
         'timerange': RangeWidget(admin.widgets.AdminSplitDateTime()),
     }
Пример #4
0
class DateRangeForm(forms.Form):
    date_range = DateRangeField(widget=RangeWidget(AdminDateWidget()))
Пример #5
0
class BookingAdminForm(forms.ModelForm):
    duration = DateTimeRangeField(widget=RangeWidget(AdminDateWidget()))