forked from rc/aircox
		
	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:
		@ -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(
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user