I have a custom made content type in FeinCMS.
class DownloadsContent(models.Model):
title = models.CharField(max_length=200, verbose_name=_('title'))
files = FileManyToMany(verbose_name=_('files'))
The ‘files’ field is an manytomany which only shows .doc and .pdf files:
class FileManyToMany(models.ManyToManyField):
def __init__(self, to=MediaFile, **kwargs):
limit = {'type__in': ['doc', 'pdf']}
limit.update(kwargs.get('limit_choices_to', {}))
kwargs['limit_choices_to'] = limit
super(FileManyToMany, self).__init__(to, **kwargs)
Untill now everything works fine. When adding this content type it shows all files.
But how can I make use of the FilteredSelectMultiple widget in my content type? Like:

In my own model field class, FileManyToMany, Add “def formfield(self, …)”
which adds the widget