<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def for_json(self):
 """Handle multi-select vs single-select"""


        if self.multiselect:
            return super(MultiSelectField, self).for_json()

        value = self.get_python()
        if hasattr(value, 'for_json'):
            return value.for_json()

        return value