1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 18:08:21 +02:00

Implement a new type of note (see #45)

This commit is contained in:
Yohann D'ANELLO
2020-03-31 01:03:30 +02:00
parent c8854cf45d
commit c384ee02eb
14 changed files with 326 additions and 21 deletions

View File

@ -7,7 +7,8 @@ from crispy_forms.layout import Layout
from django import forms
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
from django.contrib.auth.models import User
from note_kfet.inputs import Autocomplete
from note.models.notes import NoteActivity
from note_kfet.inputs import Autocomplete, AmountInput
from permission.models import PermissionMask
from .models import Profile, Club, Membership
@ -47,6 +48,31 @@ class ClubForm(forms.ModelForm):
class Meta:
model = Club
fields = '__all__'
widgets = {
"membership_fee": AmountInput()
}
class NoteActivityForm(forms.ModelForm):
class Meta:
model = NoteActivity
fields = ('note_name', 'club', 'controller', )
widgets = {
"club": Autocomplete(
Club,
attrs={
'api_url': '/api/members/club/',
}
),
"controller": Autocomplete(
User,
attrs={
'api_url': '/api/user/',
'name_field': 'username',
'placeholder': 'Nom ...',
}
)
}
class AddMembersForm(forms.Form):