test-farid/album/models.py

41 lines
1.4 KiB
Python

from django.db import models
from django.utils.translation import gettext_lazy as _
# Create your models here.
class Album(models.Model):
class OBJECT_TYPE_CHOICES(models.TextChoices):
EQUIPMENT = 'EQUIPMENT'
SUMMIT_PHOTO = 'SUMMIT_PHOTO'
CLIMBING_FILM = 'CLIMBING_FILM'
MOUNTAIN_STORY = 'MOUNTAIN_STORY'
SPECIAL_KNOWLEDGE = 'SPECIAL_KNOWLEDGE'
class TARGET_CHOICES(models.TextChoices):
DONATE_TO_MUSEUM = 'DONATE_TO_MUSEUM'
MAKE_IT_AVAILABLE_SOLELY = 'MAKE_IT_AVAILABLE_SOLELY'
object_type = models.CharField(max_length=40, choices=OBJECT_TYPE_CHOICES.choices)
description = models.TextField()
image = models.ImageField()
surname = models.CharField(max_length=40)
first_name = models.CharField(max_length=40)
birth_date = models.DateField()
address = models.TextField()
postal_code = models.CharField(max_length=10)
town = models.CharField(max_length=20)
telephone = models.CharField(max_length=20)
email = models.EmailField()
target = models.CharField(max_length=100, choices=TARGET_CHOICES.choices)
is_agreed_terms_and_cond = models.BooleanField()
is_verified = models.BooleanField(default=False, blank=True)
# Helpers
created_at = models.DateTimeField(auto_now_add=True)
modified_at = models.DateTimeField(auto_now=True)
class Meta:
verbose_name = _('Album')
verbose_name_plural = _('Albums')
ordering = ('-id',)