class HolidayAdmin(admin.ModelAdmin): list_display = ('id', 'name', 'dates') inlines = (HolidayMovedInline, ) formfield_overrides = { DateRangeField: { 'widget': RangeWidget(AdminDateWidget()) }, }
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'), }
class Meta: model = VolunteerSlot exclude = [] widgets = { 'timerange': RangeWidget(admin.widgets.AdminSplitDateTime()), }
class DateRangeForm(forms.Form): date_range = DateRangeField(widget=RangeWidget(AdminDateWidget()))
class BookingAdminForm(forms.ModelForm): duration = DateTimeRangeField(widget=RangeWidget(AdminDateWidget()))