ITRadio/server/proj/config_site/models.py

44 lines
2.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from django.db import models
from config_site.single_configuration import SingletonModel
class Page(models.Model):
name = models.CharField('Название страницы', max_length=50)
title_1 = models.TextField('Главный заголовок на странице', null=True, blank=True, max_length=300)
title_2 = models.TextField('Второй заголовок на странице', null=True, blank=True, max_length=300)
title_3 = models.TextField('Третий заголовок на странице', null=True, blank=True, max_length=300)
video = models.FileField('Видео', upload_to='videos/', null=True, blank=True)
img = models.ImageField('Изображение', blank=True, null=True, upload_to="images/")
title_4 = models.TextField('Заголовок "Поддержи нас" ', null=True, blank=True, max_length=200)
def __str__(self):
return self.name
class Team(models.Model):
name = models.CharField('Имя участника', max_length=50)
last_name = models.CharField('Фамилия участника', max_length=50)
position = models.CharField('Должность участинка', max_length=50)
img_person = models.ImageField('Изображение участника', blank=True, null=True, upload_to="team_images/")
def __str__(self):
return f"{self.last_name} {self.name} - {self.position}"
class Meta:
verbose_name = 'Команда'
verbose_name_plural = 'Команда'
class SupportInfo(SingletonModel):
phone = models.CharField('Номер телефона', max_length=50, null=True, blank=True)
city = models.CharField('Город', max_length=50, null=True, blank=True)
street = models.CharField('Улица', max_length=50, null=True, blank=True)
house = models.CharField('Номер дома', max_length=3, null=True, blank=True)
email = models.EmailField('Почта', max_length=50, null=True, blank=True)
vk_url = models.URLField('Ссылка на группу Вк', max_length=50, null=True, blank=True)
telegram_url = models.URLField('Ссылка на канал в Телегерамме', max_length=50, null=True, blank=True)
def __str__(self):
return "Информация о тех поддержке"
class Meta:
verbose_name = 'Тех поддержка'
verbose_name_plural = 'Тех поддержка'