'Computes the default columns for selecting every field in the base
model. Will sometimes be called to pull in related models (e.g. via
select_related), in which case "opts" and "start_alias" will be given
to provide a starting point for the traversal.
Returns a list of strings, quoted appropriately for use in SQL
directly, as well as a set of aliases used in the select statement (if
\'as_pairs\' is True, returns a list of (alias, col_name) pairs instead
of strings as the first component and None as the second component).
This routine is overridden from Query to handle customized selection of
geometry columns.'

def get_default_columns(self, with_aliases=False, col_aliases=None, start_alias=None, opts=None, as_pairs=False, from_parent=None):

    result = []
    if (opts is None):
        opts = self.query.get_meta()
    aliases = set()
    only_load = self.deferred_to_columns()
    seen = self.query.included_inherited_models.copy()
    if start_alias:
        seen[None] = start_alias
    for (field, model) in opts.get_concrete_fields_with_model():
        if (from_parent and (model is not None) and issubclass(from_parent, model)):
            continue
        alias = self.query.join_parent_model(opts, model, start_alias, seen)
        table = self.query.alias_map[alias].table_name
        if ((table in only_load) and (field.column not in only_load[table])):
            continue
        if as_pairs:
            result.append((alias, field))
            aliases.add(alias)
            continue
        field_sel = self.get_field_select(field, alias)
        if (with_aliases and (field.column in col_aliases)):
            c_alias = ('Col%d' % len(col_aliases))
            result.append(('%s    AS    %s' % (field_sel, c_alias)))
            col_aliases.add(c_alias)
            aliases.add(c_alias)
        else:
            r = field_sel
            result.append(r)
            aliases.add(r)
            if with_aliases:
                col_aliases.add(field.column)
    return (result, aliases)
