from django import forms

from newsreader.news.collection.models import CollectionRule


class CollectionRuleBulkForm(forms.Form):
    rules = forms.ModelMultipleChoiceField(queryset=CollectionRule.objects.none())

    def __init__(self, user, *args, **kwargs):
        self.user = user

        super().__init__(*args, **kwargs)

        self.fields["rules"].queryset = CollectionRule.objects.filter(user=user)
