aboutsummaryrefslogtreecommitdiff
path: root/models.py
blob: a70e15c12289ddc28efc0ad3f0d810c905a93c26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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"