nk20/apps/activity/forms.py

26 lines
800 B
Python
Raw Normal View History

2020-03-27 00:31:54 +00:00
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
from django import forms
from activity.models import Activity
from member.models import Club
from note_kfet.inputs import DateTimePickerInput, AutocompleteModelSelect
2020-03-27 00:31:54 +00:00
class ActivityForm(forms.ModelForm):
class Meta:
model = Activity
fields = '__all__'
widgets = {
"organizer": AutocompleteModelSelect(
model=Club,
attrs={"api_url": "/api/members/club/"},
),
"attendees_club": AutocompleteModelSelect(
model=Club,
attrs={"api_url": "/api/members/club/"},
),
"date_start": DateTimePickerInput(),
"date_end": DateTimePickerInput(),
}