site_tps/settings/models.py

38 lines
901 B
Python
Raw Normal View History

2018-01-14 12:19:11 +00:00
from django.db import models
class SiteSettings(models.Model):
2018-02-28 14:06:55 +00:00
PRETTY_NAME = "Réglages du site"
allow_upload = models.BooleanField(
2018-01-20 22:08:46 +00:00
verbose_name="Autoriser l'upload de vidéos.",
default=False,
)
2018-01-20 22:08:46 +00:00
home_message = models.TextField(
verbose_name="Message de la page d'accueil",
default=""
)
2018-03-01 11:02:22 +00:00
site_logo = models.ImageField(
verbose_name="Logo du site",
2018-03-01 11:08:41 +00:00
null=True,
blank=True
2018-03-01 11:02:22 +00:00
)
event_poster = models.ImageField(
verbose_name="Affiche de l'événement",
2018-03-01 11:08:41 +00:00
null=True,
blank=True
2018-03-01 11:02:22 +00:00
)
2018-01-20 22:08:46 +00:00
@classmethod
def get_settings(cls):
return cls.objects.get_or_create()[0]
class StaticPage(models.Model):
name = models.CharField(
max_length=255,
verbose_name="Titre de la catégorie",
)
text = models.TextField(
verbose_name="Texte de la catégorie"
)