site_tps/content/models.py

38 lines
768 B
Python
Raw Normal View History

2018-01-14 12:19:11 +00:00
from django.db import models
from django.contrib.auth.models import Group
2018-01-14 12:19:11 +00:00
class Category(models.Model):
"""Une catégorie de contenu."""
name = models.CharField(
max_length=255,
name="Nom de la catégorie"
)
2018-01-21 00:10:32 +00:00
class School(models.Model):
"""Une école."""
2018-01-21 00:10:32 +00:00
name = models.CharField(
max_length=255
)
def __str__(self):
return self.name
class Content(models.Model):
"""Un contenu du site (vidéo)."""
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,
)