'Adds the given (model) fields to the select set. The field names are
added in the order specified.'

def add_fields(self, field_names, allow_m2m=True):

    alias = self.get_initial_alias()
    opts = self.get_meta()
    try:
        for name in field_names:
            (field, targets, u2, joins, path) = self.setup_joins(name.split(LOOKUP_SEP), opts, alias, None, allow_m2m, allow_explicit_fk=True, outer_if_first=True)
            (targets, final_alias, remaining_joins) = self.trim_joins(targets, joins[(-2):], path)
            joins = (joins[:(-2)] + remaining_joins)
            self.promote_joins(joins[1:])
            for target in targets:
                self.select.append(SelectInfo((final_alias, target.column), target))
    except MultiJoin:
        raise FieldError(("Invalid    field    name:    '%s'" % name))
    except FieldError:
        if (LOOKUP_SEP in name):
            raise
        else:
            names = sorted(((opts.get_all_field_names() + list(self.extra)) + list(self.aggregate_select)))
            raise FieldError(('Cannot    resolve    keyword    %r    into    field.    Choices    are:    %s' % (name, ',    '.join(names))))
    self.remove_inherited_models()
