--- /dev/null
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.29 on 2020-11-22 14:02
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('emissions', '0015_auto_20200404_1510'),
+ ('panikombo', '0018_soundscell_sort_order'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='soundscell',
+ name='sound_format',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='emissions.Format', verbose_name='Limit to format'),
+ ),
+ ]
include_search_input = models.BooleanField(_('Include search input'), default=True)
include_fragments = models.BooleanField(_('Include fragments'), default=True)
limit_to_focus = models.BooleanField(_('Limit to focused elements'), default=False)
+ sound_format = models.ForeignKey('emissions.Format',
+ verbose_name=_('Limit to format'), null=True, blank=True)
count = models.PositiveSmallIntegerField(_('Count'), default=20)
sort_order = models.CharField(_('Sort order'), default='-creation_timestamp',
max_length=30,
soundfiles = soundfiles.filter(fragment=False)
if self.limit_to_focus:
soundfiles = soundfiles.filter(got_focus__isnull=False)
+ if self.sound_format:
+ soundfiles = soundfiles.filter(format_id=self.sound_format_id)
soundfiles = soundfiles.select_related().extra(
select={'first_diffusion': 'emissions_diffusion.datetime', },
select_params=(False, True),