aboutsummaryrefslogtreecommitdiff
path: root/models.py
diff options
context:
space:
mode:
authorAlban Gruin2017-01-18 19:13:54 +0100
committerAlban Gruin2017-01-18 19:13:54 +0100
commitf203597c7502a33134854f6f7df336a9347e16f3 (patch)
tree2b35ff029f473401c781f79ec749fa99fc3066e8 /models.py
Validation initiale
Diffstat (limited to 'models.py')
-rw-r--r--models.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/models.py b/models.py
new file mode 100644
index 0000000..a70e15c
--- /dev/null
+++ b/models.py
@@ -0,0 +1,44 @@
+from django.db import models
+
+
+class Group(models.Model):
+ name = models.CharField(max_length=255, unique=True, verbose_name="nom")
+
+ def __str__(self):
+ return self.name
+
+
+ class Meta:
+ verbose_name = "groupe"
+ verbose_name_plural = "groupes"
+
+
+class Room(models.Model):
+ name = models.CharField(max_length=255, unique=True, verbose_name="nom")
+
+ def __str__(self):
+ return self.name
+
+
+ class Meta:
+ verbose_name = "salle"
+ verbose_name_plural = "salles"
+
+
+class Course(models.Model):
+ name = models.CharField(max_length=255, verbose_name="nom")
+ type_ = models.CharField(name="type", max_length=255, verbose_name="type de cours")
+
+ groups = models.ManyToManyField(Group, verbose_name="groupes")
+ rooms = models.ManyToManyField(Room, verbose_name="salles")
+
+ begin = models.DateTimeField(verbose_name="début du cours")
+ end = models.DateTimeField(verbose_name="fin du cours")
+
+ def __str__(self):
+ return self.name
+
+
+ class Meta:
+ verbose_name = "cours"
+ verbose_name_plural = "cours"