def _get_field(self, question):
        
        # multiple choice field (select)
        if question.type == 'M':
            
            choices = [('','')] + [(c, c) for c in question.get_possible_answers()]
            return forms.ChoiceField(
                label=question.text,
                required=question.required,
                widget=forms.Select(attrs={'class':'select_choice_field'}),
                choices=choices)
                
        # multiple choice field (radio)
        if question.type == 'R':

            choices = [(c, c) for c in question.get_possible_answers()]
            return forms.ChoiceField(
                label=question.text,
                required=question.required,
                widget=forms.RadioSelect(attrs={'class':'radio_choice_field'}),
                choices=choices)
        
        # multiple choice field (checkbox)
        if question.type == 'C':
          
            choices = [(c, c) for c in question.get_possible_answers()]
            return forms.MultipleChoiceField(
                label=question.text,
                required=question.required,
                widget=forms.CheckboxSelectMultiple(attrs={'class':'checkbox_choice_field'}),
                choices=choices)
            
        # short text field
        elif question.type == 'S':
            
            return forms.CharField(
                label=question.text,
                required=question.required,
                widget=forms.TextInput(attrs={'class':'short_text_field'}))
            
        # long text field
        elif question.type == 'L':
            
            return forms.CharField(
                label=question.text,
                required=question.required,
                widget=forms.Textarea(attrs={'class':'long_text_field'}))
DESCRIPTION: Abstract class
dataset/ETHPy150Open sunlightlabs/django-simplesurvey/simplesurvey/forms.py/SurveyForm._get_field--crossover with--dataset/ETHPy150Open hycis/Pynet/pynet/datasets/dataset.py/Dataset.__init__