def __init__(self, *args, **kwargs): search_results = kwargs.pop("search_results", []) super(AssignTopicToClustersForm, self).__init__(*args, **kwargs) self.fields['topic'] = forms.ChoiceField(choices=get_topics_options(), required=False) self.fields['selected_clusters'] = forms.MultipleChoiceField( label="Select clusters", choices=get_search_clusters(search_results), widget=forms.CheckboxSelectMultiple, required=False)
class TopicClassificationForm(forms.Form): topic = forms.ChoiceField(choices=get_topics_options()) model_name = forms.ChoiceField(choices=get_models_options())
class GenerateSampleForm(forms.Form): filename = forms.CharField(max_length=25) topic = forms.ChoiceField(choices=get_topics_options())
class AssignTopicFromFileForm(forms.Form): topic = forms.ChoiceField(choices=get_topics_options()) file = forms.FileField()
class TopicsForm(forms.Form): tree_name = forms.CharField(max_length=25) topic = forms.ChoiceField(choices=get_topics_options())