virtualenv --system-site-packages
[davin.git] / ateliers / django / carto_1_1 / annuaire / models.py
1 # -*- encoding: utf-8 -*-
2
3 from django.db import models
4
5 class Etablissement(models.Model):
6 nom = models.CharField(max_length=255)
7 sigle = models.CharField(max_length=50, blank=True, null=True)
8
9 def __unicode__(self):
10 return self.nom
11
12 class Personne(models.Model):
13 nom = models.CharField(max_length=255)
14 prenom = models.CharField(max_length=255, blank=True, null=True)
15 date_naissance = models.DateField(blank=True, null=True)
16
17 universite = models.ForeignKey('Etablissement', blank=True, null=True,
18 related_name="personnes")
19
20 def __unicode__(self):
21 return "%s %s" % (self.nom.upper(), self.prenom)