1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-07-21 16:39:12 +02:00

Family views

This commit is contained in:
Ehouarn
2025-07-17 17:07:47 +02:00
parent 3ebadf34bc
commit 65dd42fc97
7 changed files with 227 additions and 8 deletions

View File

@ -3,7 +3,6 @@
from django import forms
from django.forms.widgets import NumberInput
from django.utils.translation import gettext_lazy as _
from note_kfet.inputs import Autocomplete
from .models import Challenge, FamilyMembership, User
@ -19,3 +18,21 @@ class ChallengeUpdateForm(forms.ModelForm):
widgets = {
"points": NumberInput()
}
class FamilyMembershipForm(forms.ModelForm):
class Meta:
model = FamilyMembership
fields = ('user', )
widgets = {
"user":
Autocomplete(
User,
attrs={
'api_url': '/api/user/',
'name_field': 'username',
'placeholder': 'Nom ...',
},
)
}