add 'defer()' function

Issue #802 resolved
Mike Bayer repo owner created an issue

as described on the dev list:

http://groups.google.com/group/sqlalchemy-devel/browse_thread/thread/c76e639d74d204de

# defer an attribute
defer(instance, 'someattribute')

# defer multiple attributes
defer(instance, 'someattr', 'someattr2')

# works for column() and relation() attributes !

# bonus: add autodefer option to relation().
# attaches an event handler to foo.bar_id (or whatever
# is in foreign_keys) which defer the attribute.
mapper(Foo, foo, properties={
  'bar':relation(Bar, autodefer=True) 
})

Comments (2)

  1. Log in to comment