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),