Re: [Sqlalchemy-tickets] [sqlalchemy] #1418: Flexible deferred interface
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2013-08-17 20:08:33
|
#1418: Flexible deferred interface
------------------------------+-------------------------------
Reporter: guest | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone: 0.9.0
Component: orm | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: in queue |
------------------------------+-------------------------------
Changes (by zzzeek):
* milestone: 0.x.xx => 0.9.0
Comment:
maybe if we enhance the path system a bit, we can work up compositions, so
a "defer all but" would do this:
{{{
sess.query(Entity).options(defer(Entity), undefer(Entity.foo),
undefer(Entity.bar))
}}}
that is we enhance the option system to somehow expand out given an entity
class instead of an attribute. more syntax ideas:
{{{
sess.query(Entity).options(defer(Entity).undefer("foo", "bar"))
# can we figure out the damn *keys thing with defer()/undefer()?
separate strings
# should really mean multiple keys...
sess.query(Entity).options(undefer("foo", "bar"))
# .. but then this doesn't work, sigh. the problem is pathing.
# we've never worked out a coherent pathing system. sucks
sess.query(Entity).options(undefer(Entity.widget, Widget.bars))
sess.query(as_entity(Entity.foo, Entity.bar))
sess.query(defer(Entity).undefer("foo", "bar")) # less typing, basically
need to add some interface to Query
# that accepts an option
and turns it into an entity + option
# pathing has to keep working too
sess.query(Entity).options(defer("widgets.bats").undefer("foo", "bar"))
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/1418#comment:8>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|