Custom auto-complete fields, remove DAL requirement
This commit is contained in:
parent
823bcfe781
commit
f09364d3d8
15 changed files with 117 additions and 117 deletions
|
|
@ -3,7 +3,8 @@
|
|||
|
||||
from django import forms
|
||||
from activity.models import Activity
|
||||
from note_kfet.inputs import DateTimePickerInput
|
||||
from member.models import Club
|
||||
from note_kfet.inputs import DateTimePickerInput, AutocompleteModelSelect
|
||||
|
||||
|
||||
class ActivityForm(forms.ModelForm):
|
||||
|
|
@ -11,6 +12,14 @@ class ActivityForm(forms.ModelForm):
|
|||
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(),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue