# Path: radioco/apps/schedules/models.py
# WEEKDAY_CHOICES = (
#     (MO, _('Monday')),
#     (TU, _('Tuesday')),
#     (WE, _('Wednesday')),
#     (TH, _('Thursday')),
#     (FR, _('Friday')),
#     (SA, _('Saturday')),
#     (SU, _('Sunday')),
# )


import datetime
from django.conf import settings
from django.contrib.auth.models import User
from django.core.cache import cache
from django.db import models
from django.utils.translation import ugettext as _u
from django.utils.translation import ugettext_lazy as _
from rest_framework.authtoken.models import Token
from radioco.apps.schedules.models import WEEKDAY_CHOICES

    @property
    def recorder_token(self):
        if hasattr(settings, 'USERNAME_RADIOCO_RECORDER'):
            username = settings.USERNAME_RADIOCO_RECORDER
            user, created = User.objects.get_or_create(username=username)
            if created:
                user.set_password(User.objects.make_random_password())
                user.save()
            token, created = Token.objects.get_or_create(user=user)
            return token.key
        else:
            return _('Variable USERNAME_RADIOCO_RECORDER doesn\'t exist in your settings file')

    def __str__(self):
        # In django 1.7 we can't use lazy
        return _u('Podcast Configuration')

    class Meta:
        default_permissions = ('change',)
        verbose_name = _('Podcast Configuration')
        verbose_name_plural = _('Podcast Configuration')


class CalendarConfiguration(SingletonModel):
    slot_duration = models.DurationField(
        default=datetime.timedelta(minutes=30), verbose_name=_('slot duration'),
        help_text=_('The frequency for displaying time slots. Format hh:mm:ss'))

    first_day = models.IntegerField(

# Path: radioco/apps/schedules/models.py
# WEEKDAY_CHOICES = (
#     (MO, _('Monday')),
#     (TU, _('Tuesday')),
#     (WE, _('Wednesday')),
#     (TH, _('Thursday')),
#     (FR, _('Friday')),
#     (SA, _('Saturday')),
#     (SU, _('Sunday')),
# )


# Path: radioco/apps/global_settings/models.py
import datetime
from django.conf import settings
from django.contrib.auth.models import User
from django.core.cache import cache
from django.db import models
from django.utils.translation import ugettext as _u
from django.utils.translation import ugettext_lazy as _
from rest_framework.authtoken.models import Token
from radioco.apps.schedules.models import WEEKDAY_CHOICES


    @property
    def recorder_token(self):
        if hasattr(settings, 'USERNAME_RADIOCO_RECORDER'):
            username = settings.USERNAME_RADIOCO_RECORDER
            user, created = User.objects.get_or_create(username=username)
            if created:
                user.set_password(User.objects.make_random_password())
                user.save()
            token, created = Token.objects.get_or_create(user=user)
            return token.key
        else:
            return _('Variable USERNAME_RADIOCO_RECORDER doesn\'t exist in your settings file')

    def __str__(self):
        # In django 1.7 we can't use lazy
        return _u('Podcast Configuration')

    class Meta:
        default_permissions = ('change',)
        verbose_name = _('Podcast Configuration')
        verbose_name_plural = _('Podcast Configuration')


class CalendarConfiguration(SingletonModel):
    slot_duration = models.DurationField(
        default=datetime.timedelta(minutes=30), verbose_name=_('slot duration'),
        help_text=_('The frequency for displaying time slots. Format hh:mm:ss'))

    first_day = models.IntegerField(

        choices=WEEKDAY_CHOICES, default=0, verbose_name=_('first day'),