def get_poll_option_formset_kwargs(self):
        """
        Returns the keyword arguments for instantiating the poll option formset.
        """
        kwargs = {
            'prefix': 'poll',
        }

        if self.request.method in ('POST', 'PUT'):
            kwargs.update({
                'data': self.request.POST,
                'files': self.request.FILES,
            })
        else:
            topic = self.get_topic()
            poll_option_queryset = TopicPollOption.objects.filter(poll__topic=topic)
            kwargs.update({
                'queryset': poll_option_queryset,
            })
        return kwargs
dataset/ETHPy150Open ellmetha/django-machina/machina/apps/forum_conversation/views.py/BaseTopicFormView.get_poll_option_formset_kwargs/original