def _hasfield(model_fields, field_name):
    """
    Check if field name exists in list of model fields

    :param list model_fields: List of Django Model object fields
    :param string field_name: attribute string, dotted or dunderscored.
    example: 'user.first_name' or 'user__first_name'

    :returns: Field object or False

    """
    for field in model_fields:
        if field.name == field_name:
            return field
    return False