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):
|
2022-09-26 22:49:42 +00:00
|
|
|
class OBJECT_TYPE_CHOICES(models.TextChoices):
|
|
|
|
EQUIPMENT = 'EQUIPMENT'
|
|
|
|
SUMMIT_PHOTO = 'SUMMIT_PHOTO'
|
|
|
|
CLIMBING_FILM = 'CLIMBING_FILM'
|
|
|
|
MOUNTAIN_STORY = 'MOUNTAIN_STORY'
|
|
|
|
SPECIAL_KNOWLEDGE = 'SPECIAL_KNOWLEDGE'
|
|
|
|
|
2022-09-28 01:27:56 +00:00
|
|
|
class TARGET_CHOICES(models.TextChoices):
|
|
|
|
DONATE_TO_MUSEUM = 'DONATE_TO_MUSEUM'
|
|
|
|
MAKE_IT_AVAILABLE_SOLELY = 'MAKE_IT_AVAILABLE_SOLELY'
|
|
|
|
|
2022-09-26 22:49:42 +00:00
|
|
|
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()
|
2022-09-26 22:49:42 +00:00
|
|
|
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()
|
2022-09-28 01:27:56 +00:00
|
|
|
target = models.CharField(max_length=100, choices=TARGET_CHOICES.choices)
|
2022-09-26 22:49:42 +00:00
|
|
|
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',)
|