<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_m2m_widget(cls, field):
 """ Prepare widget for m2m field """

        return functools.partial(
            widgets.ManyToManyWidget,
            model=get_related_model(field))