1
0
mirror of https://gitlab.crans.org/mediatek/med.git synced 2025-07-07 16:28:32 +02:00

Gestion des clefs

This commit is contained in:
Med
2017-07-03 20:06:21 +02:00
parent b2a653dd97
commit 0738b143b7
11 changed files with 275 additions and 3 deletions

View File

@ -208,6 +208,11 @@ class ListRight(models.Model):
def __str__(self):
return self.listright
class Clef(models.Model):
nom = models.CharField(max_length=255, unique=True)
proprio = models.ForeignKey('User', on_delete=models.PROTECT, blank=True, null=True)
commentaire = models.CharField(max_length=255, null=True, blank=True)
class BaseInfoForm(ModelForm):
def __init__(self, *args, **kwargs):
super(BaseInfoForm, self).__init__(*args, **kwargs)
@ -249,6 +254,11 @@ class StateForm(ModelForm):
model = User
fields = ['state']
class ClefForm(ModelForm):
class Meta:
model = Clef
fields = '__all__'
class RightForm(ModelForm):
def __init__(self, *args, **kwargs):
super(RightForm, self).__init__(*args, **kwargs)