1. dobrych
  2. mediatr

Source

mediatr / forms.py

from django import forms
from django.forms.models import inlineformset_factory
from django.utils.translation import ugettext_lazy as _, ugettext

from models import Item, Batch, Stream


class UploadForm(forms.ModelForm):
    stream = forms.ModelMultipleChoiceField(Stream.objects.all(), required=False,
                                            widget=forms.CheckboxSelectMultiple())
    
    class Meta:
        model = Item
        fields = ('name', 'file', 'stream')

MultiUploadFormset = inlineformset_factory(Batch, Item, form=UploadForm)