X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/77effa3964014b07dbdf73a9e67eb0b20749d50b..5761df5a5d4d40ba7c82e1b1277af30cedeb8306:/catalogue/forms.py?ds=inline diff --git a/catalogue/forms.py b/catalogue/forms.py index 583c9aed7..279ec7193 100644 --- a/catalogue/forms.py +++ b/catalogue/forms.py @@ -25,14 +25,14 @@ class UserSetsForm(forms.Form): ) -class BookSetsForm(forms.Form): - def __init__(self, book, user, *args, **kwargs): - super(BookSetsForm, self).__init__(*args, **kwargs) +class ObjectSetsForm(forms.Form): + def __init__(self, obj, user, *args, **kwargs): + super(ObjectSetsForm, self).__init__(*args, **kwargs) self.fields['set_ids'] = forms.MultipleChoiceField( label=u'Półki', required=False, choices=[(tag.id, tag.name) for tag in Tag.objects.filter(category='set', user=user)], - initial=[tag.id for tag in book.tags.filter(category='set', user=user)], + initial=[tag.id for tag in obj.tags.filter(category='set', user=user)], widget=forms.CheckboxSelectMultiple )