2018-01-14 12:19:11 +00:00
|
|
|
from django.db import models
|
2018-01-14 18:05:53 +00:00
|
|
|
from django.contrib.auth.models import Group
|
2018-01-14 12:19:11 +00:00
|
|
|
|
2018-01-14 18:05:53 +00:00
|
|
|
|
|
|
|
class Category(models.Model):
|
2018-01-22 13:03:25 +00:00
|
|
|
"""Une catégorie de contenu."""
|
2018-01-14 18:05:53 +00:00
|
|
|
name = models.CharField(
|
|
|
|
max_length=255,
|
|
|
|
name="Nom de la catégorie"
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2018-01-21 00:10:32 +00:00
|
|
|
class School(models.Model):
|
2018-01-22 13:03:25 +00:00
|
|
|
"""Une école."""
|
2018-01-21 00:10:32 +00:00
|
|
|
name = models.CharField(
|
|
|
|
max_length=255
|
|
|
|
)
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return self.name
|
|
|
|
|
|
|
|
|
2018-01-14 18:05:53 +00:00
|
|
|
class Content(models.Model):
|
2018-01-22 13:03:25 +00:00
|
|
|
"""Un contenu du site (vidéo)."""
|
2018-01-14 18:05:53 +00:00
|
|
|
name = models.CharField(
|
|
|
|
max_length=255,
|
|
|
|
name="Nom du contenu"
|
|
|
|
)
|
|
|
|
group_owner = models.ForeignKey(
|
|
|
|
Group,
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
editable=False,
|
|
|
|
)
|
|
|
|
content_url = models.URLField(
|
|
|
|
name='URL du contenu',
|
|
|
|
editable=False,
|
|
|
|
)
|