added pronoun to fields

This commit is contained in:
Ju Luiselli 2020-02-19 20:42:36 +00:00
parent 316a9448a4
commit 715566db8a
4 changed files with 26 additions and 1 deletions

View file

@ -8,6 +8,7 @@ class ProfileForm(forms.ModelForm):
fields = [ fields = [
"full_name", "full_name",
"nickname", "nickname",
"pronoun",
"picture", "picture",
"department", "department",
"promotion", "promotion",

View file

@ -0,0 +1,18 @@
# Generated by Django 2.2.9 on 2020-02-19 20:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fiches', '0004_auto_20200212_2130'),
]
operations = [
migrations.AddField(
model_name='profile',
name='pronoun',
field=models.CharField(blank=True, max_length=15, verbose_name='pronom utilisé'),
),
]

View file

@ -13,6 +13,7 @@ class Profile(models.Model):
) )
full_name = models.CharField(max_length=1023, verbose_name=_("nom")) full_name = models.CharField(max_length=1023, verbose_name=_("nom"))
nickname = models.CharField(blank=True, max_length=1023, verbose_name=_("surnom")) nickname = models.CharField(blank=True, max_length=1023, verbose_name=_("surnom"))
pronoun = models.CharField(blank=True, max_length = 15, verbose_name=_("pronom utilisé"))
picture = models.ImageField( picture = models.ImageField(
blank=True, upload_to="picture", verbose_name=_("photo") blank=True, upload_to="picture", verbose_name=_("photo")
) )

View file

@ -8,8 +8,13 @@
<h3>{{ profile.full_name }} <h3>{{ profile.full_name }}
({{ profile.promotion }}) ({{ profile.promotion }})
{% if profile.nickname %} {% if profile.nickname %}
<em>alias:</em>{{ profile.nickname }})</h3> (<em>alias:</em>{{ profile.nickname }})</h3>
{% endif %} {% endif %}
<p>
{% if profile.pronoun %}
<em>Pronom utilisé :</em>{{ profile.pronoun }}
{% endif %}
</p>
<p> <p>
{% if profile.department.exists %} {% if profile.department.exists %}
<em>Département{{ profile.department.count|pluralize}} :</em> <em>Département{{ profile.department.count|pluralize}} :</em>