X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/3748094efcd5ed3b89408ece388a6e94ea42990c..4b5ed2ce2a3a8bf845c2831666661365e0c09f09:/apps/social/forms.py?ds=sidebyside diff --git a/apps/social/forms.py b/apps/social/forms.py index cfa963177..5834ffa24 100755 --- a/apps/social/forms.py +++ b/apps/social/forms.py @@ -14,7 +14,8 @@ class UserSetsForm(forms.Form): def __init__(self, book, user, *args, **kwargs): super(UserSetsForm, self).__init__(*args, **kwargs) self.fields['set_ids'] = forms.ChoiceField( - choices=[(tag.id, tag.name) for tag in Tag.objects.filter(category='set', user=user)], + choices=[(tag.id, tag.name) for tag in + Tag.objects.filter(category='set', user=user).iterator()], ) @@ -28,7 +29,7 @@ class ObjectSetsForm(forms.Form): data = kwargs.setdefault('data', {}) if 'tags' not in data and user.is_authenticated(): data['tags'] = ', '.join(t.name - for t in obj.tags.filter(category='set', user=user) if t.name) + for t in obj.tags.filter(category='set', user=user).iterator() if t.name) super(ObjectSetsForm, self).__init__(*args, **kwargs) def save(self, request):