def contribute_to_class(self, cls, name):
        super(TextMultiSelectField, self).contribute_to_class(cls, name)
        if self.choices:
            def _func(self, fieldname=name, choicedict=dict(self.choices)):
                return self.separate_values_by.join([
                    choicedict.get(value, value) for value in
                    getattr(self, fieldname)
                ])
            setattr(cls, 'get_%s_display' % self.name, _func)
dataset/ETHPy150Open chhantyal/dj-dynamic-forms/dynamic_forms/fields.py/TextMultiSelectField.contribute_to_class/original