mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-24 22:16:37 +00:00
Add WeekDay
choice
This commit is contained in:
parent
9289a619ee
commit
4d3ea48af7
@ -167,6 +167,28 @@ class TaskQueue(models.TextChoices):
|
||||
NET = 'network', _('Networking')
|
||||
|
||||
|
||||
class WeekDay(models.IntegerChoices):
|
||||
MON = 0, _('Monday')
|
||||
TUE = 1, _('Tuesday')
|
||||
WED = 2, _('Wednesday')
|
||||
THU = 3, _('Thursday')
|
||||
FRI = 4, _('Friday')
|
||||
SAT = 5, _('Saturday')
|
||||
SUN = 6, _('Sunday')
|
||||
|
||||
@classmethod
|
||||
def get(cls, wdn, /):
|
||||
return cls[cls.names[wdn]]
|
||||
|
||||
@classmethod
|
||||
def _from_iso(cls, wdn, /):
|
||||
return cls[cls.names[wdn - 1]]
|
||||
|
||||
@classmethod
|
||||
def _to_iso(cls, choice, /):
|
||||
return 1 + choice.value
|
||||
|
||||
|
||||
class YouTube_SourceType(models.TextChoices):
|
||||
CHANNEL = 'c', _('YouTube channel')
|
||||
CHANNEL_ID = 'i', _('YouTube channel by ID')
|
||||
|
Loading…
Reference in New Issue
Block a user