mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-07-21 16:39:12 +02:00
Family views
This commit is contained in:
@ -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 ...',
|
||||
},
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user