def expand(self, model=None, ignoreFilter=False):
model = self.__model or model<EOL>if not model:<EOL><INDENT>raise orb.errors.QueryInvalid('<STR_LIT>'.format(self.__column))<EOL><DEDENT>schema = model.schema()<EOL>parts = self.__column.split('<STR_LIT:.>')<EOL>lookup = schema.column(parts[<NUM_LIT:0>], raise_=False) or schema.collector(parts[<NUM_LIT:0>])<EOL>if lookup:<EOL><INDENT>query_filter = lookup.queryFilterMethod()<EOL>if callable(query_filter) and not ignoreFilter:<EOL><INDENT>new_q = query_filter(model, self)<EOL>if new_q:<EOL><INDENT>return new_q.expand(model, ignoreFilter=True)<EOL><DEDENT>else:<EOL><INDENT>return None<EOL><DEDENT><DEDENT>elif isinstance(lookup, orb.Column) and lookup.shortcut():<EOL><INDENT>parts = lookup.shortcut().split('<STR_LIT:.>')<EOL>lookup = schema.column(parts[<NUM_LIT:0>], raise_=False)<EOL><DEDENT><DEDENT>if len(parts) == <NUM_LIT:1>:<EOL><INDENT>return self<EOL><DEDENT>else:<EOL><INDENT>if isinstance(lookup, orb.Collector):<EOL><INDENT>return orb.Query(model).in_(lookup.collectExpand(self, parts))<EOL><DEDENT>elif isinstance(lookup, orb.ReferenceColumn):<EOL><INDENT>rmodel = lookup.referenceModel()<EOL>sub_q = self.copy()<EOL>sub_q._Query__column = '<STR_LIT:.>'.join(parts[<NUM_LIT:1>:])<EOL>sub_q._Query__model = rmodel<EOL>records = rmodel.select(columns=[rmodel.schema().idColumn()], where=sub_q)<EOL>return orb.Query(model, parts[<NUM_LIT:0>]).in_(records)<EOL><DEDENT>else:<EOL><INDENT>raise orb.errors.QueryInvalid('<STR_LIT>'.format(self.__column))<EOL><DEDENT><DEDENT>
Expands any shortcuts that were created for this query.  Shortcuts
provide the user access to joined methods using the '.' accessor to
access individual columns for referenced tables.

:param      model | <orb.Model> || None

:usage      |>>> from orb import Query as Q
            |>>> # lookup the 'username' of foreign key 'user'
            |>>> Q('user.username') == 'bob.smith'

:return     <orb.Query> || <orb.QueryCompound>