2018-01-14 12:19:11 +00:00
|
|
|
from django.db import models
|
|
|
|
|
2018-01-22 20:26:37 +00:00
|
|
|
from .aes_field import AESEncryptedField
|
2018-01-14 18:05:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ContentSettings(models.Model):
|
|
|
|
ftp_url = models.URLField(
|
|
|
|
max_length=255,
|
2018-01-20 22:08:46 +00:00
|
|
|
verbose_name="URL du FTP",
|
|
|
|
default="",
|
2018-01-14 18:05:53 +00:00
|
|
|
)
|
|
|
|
ftp_id = models.CharField(
|
|
|
|
max_length=255,
|
2018-01-20 22:08:46 +00:00
|
|
|
verbose_name="Identifiant sur le FTP",
|
|
|
|
default=""
|
2018-01-14 18:05:53 +00:00
|
|
|
)
|
|
|
|
ftp_pass = AESEncryptedField(
|
|
|
|
max_length=255,
|
2018-01-20 22:08:46 +00:00
|
|
|
verbose_name="Mot de passe",
|
|
|
|
default=""
|
2018-01-14 18:05:53 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class SiteSettings(models.Model):
|
|
|
|
allow_upload = models.BooleanField(
|
2018-01-20 22:08:46 +00:00
|
|
|
verbose_name="Autoriser l'upload de vidéos.",
|
|
|
|
default=False,
|
2018-01-14 18:05:53 +00:00
|
|
|
)
|
2018-01-20 22:08:46 +00:00
|
|
|
home_message = models.TextField(
|
|
|
|
verbose_name="Message de la page d'accueil",
|
|
|
|
default=""
|
2018-01-14 18:05:53 +00:00
|
|
|
)
|
2018-01-20 22:08:46 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def get_settings(cls):
|
|
|
|
return cls.objects.get_or_create()[0]
|