remove Station model (to much trouble for few advantages); start new player; rename Post.detail_url to Post.url, same for ListItem; move Article into website app; add website.Sound post; work on lists;...

This commit is contained in:
bkfox
2016-06-12 21:34:31 +02:00
parent 13bf57b401
commit c3ae0e012c
18 changed files with 180 additions and 196 deletions

View File

@ -1,24 +1,19 @@
from enum import Enum, IntEnum
from django.db import models
from django.utils.translation import ugettext as _, ugettext_lazy
import aircox.programs.models as programs
class Output (models.Model):
# Note: we don't translate the names since it is project names.
Type = {
'jack': 0x00,
'alsa': 0x01,
'icecast': 0x02,
}
class Type(IntEnum):
jack = 0x00
alsa = 0x01
icecast = 0x02
station = models.ForeignKey(
programs.Station,
verbose_name = _('station'),
)
type = models.SmallIntegerField(
_('output type'),
choices = [ (y, x) for x,y in Type.items() ],
choices = [ (int(y), _(x)) for x,y in Type.__members__.items() ],
blank = True, null = True
)
settings = models.TextField(