test-farid/album/models.py

42 lines
1.4 KiB
Python
Raw Normal View History

2022-09-25 23:46:58 +00:00
from django.db import models
2022-09-26 01:14:05 +00:00
from django.utils.translation import gettext_lazy as _
2022-09-25 23:46:58 +00:00
# Create your models here.
2022-09-26 01:14:05 +00:00
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()
2022-09-26 01:14:05 +00:00
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()
2022-09-26 01:14:05 +00:00
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',)