You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

39 lines
1.2 KiB

from django.db import models
# Create your models here.
class CalendarOccasions(models.Model):
"""
calendar events model
"""
class OccasionType(models.TextChoices):
GEORGIAN = 'georgian', _('georgian')
LUNAR = 'lunar', _('lunar')
class EventType(models.TextChoices):
national = 'national', _('National')
international = 'international', _('International')
religious = 'religious', _('Religious')
title = models.CharField(_("title"), max_length=255)
is_global = models.BooleanField(
verbose_name=_('is global'), default=False,
help_text=_('check this field if event is global'),
)
occasion_type = models.CharField(
choices=OccasionType.choices,
default=OccasionType.GEORGIAN,
max_length=12,
help_text=_('Choose between georgian or lunar. default to georgian'),
verbose_name=_('occasion type')
)
dates = models.JSONField(verbose_name=_('dates'))
is_yearly = models.BooleanField(
verbose_name=_('is yearly'), default=True,
help_text=_('check this field if event is annually')
)
updated_at = models.DateTimeField(auto_now=True, verbose_name=_('updated at'))