mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-28 01:43:46 +00:00
Comentaires de maxime sur le champ promo
This commit is contained in:
parent
ffb84ec97c
commit
781d550263
5 changed files with 58 additions and 4 deletions
24
users/migrations/0013_auto_20160704_1547.py
Normal file
24
users/migrations/0013_auto_20160704_1547.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('users', '0012_auto_20160703_1230'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='user',
|
||||
name='comment',
|
||||
field=models.CharField(max_length=255, help_text="Infos sur l'etablissement (optionnel)", blank=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='user',
|
||||
name='promo',
|
||||
field=models.CharField(max_length=255, blank=True),
|
||||
),
|
||||
]
|
23
users/migrations/0014_auto_20160704_1548.py
Normal file
23
users/migrations/0014_auto_20160704_1548.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('users', '0013_auto_20160704_1547'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='user',
|
||||
name='promo',
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='user',
|
||||
name='comment',
|
||||
field=models.CharField(blank=True, help_text='Commentaire, promo', max_length=255),
|
||||
),
|
||||
]
|
|
@ -30,7 +30,7 @@ class User(models.Model):
|
|||
pseudo = models.CharField(max_length=255, unique=True)
|
||||
email = models.EmailField()
|
||||
school = models.ForeignKey('School', on_delete=models.PROTECT)
|
||||
promo = models.CharField(max_length=255)
|
||||
comment = models.CharField(help_text="Commentaire, promo", max_length=255, blank=True)
|
||||
room = models.OneToOneField('topologie.Room', on_delete=models.PROTECT, blank=True, null=True)
|
||||
pwd_ssha = models.CharField(max_length=255)
|
||||
pwd_ntlm = models.CharField(max_length=255)
|
||||
|
@ -77,6 +77,8 @@ class UserForm(ModelForm):
|
|||
self.fields['name'].label = 'Nom'
|
||||
self.fields['surname'].label = 'Prenom'
|
||||
self.fields['school'].label = 'Etablissement'
|
||||
self.fields['comment'].label = 'Commentaire'
|
||||
self.fields['room'].label = 'Chambre'
|
||||
|
||||
class Meta:
|
||||
model = User
|
||||
|
@ -90,6 +92,8 @@ class InfoForm(ModelForm):
|
|||
self.fields['name'].label = 'Nom'
|
||||
self.fields['surname'].label = 'Prenom'
|
||||
self.fields['school'].label = 'Etablissement'
|
||||
self.fields['comment'].label = 'Commentaire'
|
||||
self.fields['room'].label = 'Chambre'
|
||||
|
||||
def clean_force(self):
|
||||
if self.cleaned_data.get('force', False):
|
||||
|
@ -98,7 +102,7 @@ class InfoForm(ModelForm):
|
|||
|
||||
class Meta:
|
||||
model = User
|
||||
fields = ['name','surname','pseudo','email', 'school', 'promo', 'room']
|
||||
fields = ['name','surname','pseudo','email', 'school', 'comment', 'room']
|
||||
|
||||
class PasswordForm(ModelForm):
|
||||
class Meta:
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
<tr>
|
||||
<th>Ecole</th>
|
||||
<td>{{ user.school }}</td>
|
||||
<th>Promo</th>
|
||||
<td>{{ user.promo }}</td>
|
||||
<th>Commentaire</th>
|
||||
<td>{{ user.comment }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Chambre</th>
|
||||
|
|
|
@ -11,4 +11,7 @@
|
|||
{% bootstrap_form userform %}
|
||||
{% bootstrap_button "Créer ou modifier" button_type="submit" icon="star" %}
|
||||
</form>
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue