(field)
Given a field, returns the number of choices.
Given a field, returns the number of choices.
Given a field returns the number of choices .
def number_field_choices(field):
    """
        Given a field, returns the number of choices.
    """
    try:
        return len(field.get_flat_choices())
    except AttributeError:
        return 0
def number_field_choices ( field ) : try : return len ( field . get_flat_choices ( ) ) except AttributeError : return 0