<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_formfield(model, field):
 """ Return the formfied associate to the field of the model """

    class_field = model._meta.get_field(field)

    if hasattr(class_field, "field"):
        formfield = class_field.field.formfield()
    else:
        formfield = class_field.formfield()
    
    # Otherwise the formfield contain the reverse relation
    if isinstance(formfield, ChoiceField):
        formfield.choices = class_field.get_choices()
    
    return formfield