33 lines
886 B
Python
33 lines
886 B
Python
from django.db import models
|
|
|
|
from .aes_field import AESEncryptedField
|
|
|
|
|
|
class SiteSettings(models.Model):
|
|
PRETTY_NAME = "Réglages du site"
|
|
allow_upload = models.BooleanField(
|
|
verbose_name="Autoriser l'upload de vidéos.",
|
|
default=False,
|
|
)
|
|
home_message = models.TextField(
|
|
verbose_name="Message de la page d'accueil",
|
|
default=""
|
|
)
|
|
site_logo = models.ImageField(
|
|
verbose_name="Logo du site",
|
|
null=True,
|
|
blank=True
|
|
)
|
|
event_poster = models.ImageField(
|
|
verbose_name="Affiche de l'événement",
|
|
null=True,
|
|
blank=True
|
|
)
|
|
min_number_of_categories = models.PositiveIntegerField(
|
|
verbose_name="Nombre minimal de catégories dans laquelle participer",
|
|
default=0,
|
|
)
|
|
|
|
@classmethod
|
|
def get_settings(cls):
|
|
return cls.objects.get_or_create()[0]
|