Small model tweaks

This commit is contained in:
Ludovic Stephan 2020-11-13 11:39:28 +01:00
parent a73496cd67
commit a51cc4bb60
3 changed files with 34 additions and 2 deletions

5
.gitignore vendored
View file

@ -3,11 +3,16 @@
*.swo
*~
*#
*.log
/media/picture
/venv/
.vagrant/
static/
*.sqlite3
fiches/templates/fiches/base_old.html
fiches/static/fiches/css_old/
.vscode

View file

@ -0,0 +1,23 @@
# Generated by Django 2.2.17 on 2020-11-13 10:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fiches', '0007_auto_20200917_1421'),
]
operations = [
migrations.AlterField(
model_name='department',
name='name',
field=models.CharField(max_length=255, unique=True, verbose_name='nom du département'),
),
migrations.AlterField(
model_name='profile',
name='birth_date',
field=models.DateField(blank=True, null=True, verbose_name='date de naissance'),
),
]

View file

@ -23,7 +23,9 @@ class Profile(models.Model):
promotion = models.IntegerField(
validators=[MinValueValidator(1980)], verbose_name=_("promotion")
)
birth_date = models.DateField(blank=True, verbose_name=_("date de naissance"))
birth_date = models.DateField(
blank=True, null=True, verbose_name=_("date de naissance")
)
thurne = models.CharField(blank=True, max_length=100, verbose_name=_("thurne"))
text_field = models.TextField(blank=True, verbose_name=_("champ libre"))
printing = models.BooleanField(
@ -41,7 +43,9 @@ class Profile(models.Model):
class Department(models.Model):
name = models.CharField(max_length=255, verbose_name=_("nom du département"))
name = models.CharField(
max_length=255, verbose_name=_("nom du département"), unique=True
)
def __str__(self):
return self.name