|
@ -56,11 +56,23 @@ class InternForm(FdbForm): |
|
|
|
|
|
|
|
|
class TravelForm(FdbForm): |
|
|
class TravelForm(FdbForm): |
|
|
# TODO: add some javascript to show/hide other-field |
|
|
# TODO: add some javascript to show/hide other-field |
|
|
|
|
|
|
|
|
|
|
|
# this is the code, to change required to false if needed |
|
|
|
|
|
def __init__(self, *args, **kwargs): |
|
|
|
|
|
super().__init__(*args, **kwargs) |
|
|
|
|
|
self.fields['project_name'].required = True |
|
|
|
|
|
self.fields['transport'].required = True |
|
|
|
|
|
self.fields['travelcost'].required = True |
|
|
|
|
|
self.fields['checkin'].required = True |
|
|
|
|
|
self.fields['checkout'].required = True |
|
|
|
|
|
self.fields['hotel'].required = True |
|
|
|
|
|
|
|
|
class Meta: |
|
|
class Meta: |
|
|
model = Travel |
|
|
model = Travel |
|
|
exclude = ('granted', 'granted_date', 'survey_mail_send', 'realname', 'email', 'survey_mail_date', 'project', 'request_url', 'payed_for_hotel_by', 'payed_for_travel_by', 'intern_notes' ) |
|
|
exclude = ('granted', 'granted_date', 'survey_mail_send', 'realname', 'email', 'survey_mail_date', 'project', 'request_url', 'payed_for_hotel_by', 'payed_for_travel_by', 'intern_notes' ) |
|
|
widgets = {'checkin': AdminDateWidget(), |
|
|
widgets = {'checkin': AdminDateWidget(), |
|
|
'checkout': AdminDateWidget(),} |
|
|
'checkout': AdminDateWidget(),} |
|
|
|
|
|
fields = ['project_name', 'transport', 'travelcost', 'checkin', 'checkout', 'hotel', 'notes'] |
|
|
|
|
|
|
|
|
class LibraryForm(FdbForm): |
|
|
class LibraryForm(FdbForm): |
|
|
|
|
|
|
|
|