feat: re-add DateWidget but only if creating
This commit is contained in:
@@ -51,6 +51,15 @@ class AdoptionNoticeForm(forms.ModelForm):
|
||||
fields = ['name', "group_only", "further_information", "description", "searching_since", "location_string"]
|
||||
|
||||
|
||||
class AdoptionNoticeFormWithDateWidget(AdoptionNoticeForm):
|
||||
class Meta:
|
||||
model = AdoptionNotice
|
||||
fields = ['name', "group_only", "further_information", "description", "searching_since", "location_string"]
|
||||
widgets = {
|
||||
'searching_since': DateInput(),
|
||||
}
|
||||
|
||||
|
||||
class AnimalForm(forms.ModelForm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
if 'in_adoption_notice_creation_flow' in kwargs:
|
||||
@@ -71,6 +80,15 @@ class AnimalForm(forms.ModelForm):
|
||||
fields = ["name", "date_of_birth", "species", "sex", "description"]
|
||||
|
||||
|
||||
class AnimalFormWithDateWidget(AnimalForm):
|
||||
class Meta:
|
||||
model = Animal
|
||||
fields = ["name", "date_of_birth", "species", "sex", "description"]
|
||||
widgets = {
|
||||
'date_of_birth': DateInput(),
|
||||
}
|
||||
|
||||
|
||||
class ImageForm(forms.ModelForm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
if 'in_flow' in kwargs:
|
||||
|
Reference in New Issue
Block a user