forked from rc/aircox
quick fix on bugs due to Django 1.10
This commit is contained in:
@ -37,14 +37,6 @@ class DiffusionInline(admin.StackedInline):
|
||||
extra = 0
|
||||
fields = ['type', 'start', 'end']
|
||||
|
||||
# from suit.admin import SortableTabularInline, SortableModelAdmin
|
||||
#class TrackInline(SortableTabularInline):
|
||||
# fields = ['artist', 'name', 'tags', 'position']
|
||||
# form = TrackForm
|
||||
# model = Track
|
||||
# sortable = 'position'
|
||||
# extra = 10
|
||||
|
||||
class NameableAdmin(admin.ModelAdmin):
|
||||
fields = [ 'name' ]
|
||||
|
||||
@ -58,7 +50,7 @@ class TrackInline(GenericTabularInline):
|
||||
ct_fk_field = 'related_id'
|
||||
model = Track
|
||||
extra = 0
|
||||
fields = ('artist', 'title', 'tags', 'info', 'position')
|
||||
fields = ('artist', 'title', 'info', 'position')
|
||||
readonly_fields = ('position',)
|
||||
|
||||
|
||||
@ -68,7 +60,8 @@ class SoundAdmin(NameableAdmin):
|
||||
list_display = ['id', 'name', 'duration', 'type', 'mtime',
|
||||
'public', 'good_quality']
|
||||
fieldsets = [
|
||||
(None, { 'fields': NameableAdmin.fields + ['path', 'type', 'diffusion'] } ),
|
||||
(None, { 'fields': NameableAdmin.fields +
|
||||
['path', 'type', 'program', 'diffusion'] } ),
|
||||
(None, { 'fields': ['embed', 'duration', 'public', 'mtime'] }),
|
||||
(None, { 'fields': ['good_quality' ] } )
|
||||
]
|
||||
|
@ -291,6 +291,8 @@ class Command(BaseCommand):
|
||||
if not program.ensure_dir(subdir):
|
||||
return
|
||||
|
||||
sound_kwargs['program'] = program
|
||||
|
||||
subdir = os.path.join(program.path, subdir)
|
||||
sounds = []
|
||||
|
||||
|
@ -123,11 +123,17 @@ class Sound(Nameable):
|
||||
excerpt = 0x02,
|
||||
removed = 0x03,
|
||||
|
||||
program = models.ForeignKey(
|
||||
'Program',
|
||||
verbose_name = _('program'),
|
||||
blank = True, null = True,
|
||||
help_text = _('program related to it'),
|
||||
)
|
||||
diffusion = models.ForeignKey(
|
||||
'Diffusion',
|
||||
verbose_name = _('diffusion'),
|
||||
blank = True, null = True,
|
||||
help_text = _('this is set for scheduled programs')
|
||||
help_text = _('initial diffusion related it')
|
||||
)
|
||||
type = models.SmallIntegerField(
|
||||
verbose_name = _('type'),
|
||||
|
Reference in New Issue
Block a user