kept separate from the normal mapper setup, thereby
preventing conflicts with lazy loader operation, fixes
[ticket:308]
+- fix to deferred group loading
0.2.8
- cleanup on connection methods + documentation. custom DBAPI
continue
# set a scalar object instance directly on the object,
# bypassing SmartProperty event handlers.
- instance.__dict__[prop.key] = row[prop.columns[0]]
sessionlib.attribute_manager.init_instance_attribute(instance, prop.key, uselist=False)
+ instance.__dict__[prop.key] = row[prop.columns[0]]
return row[self.columns[0]]
finally:
result.close()
def testgroup(self):
"""tests deferred load with a group"""
-
m = mapper(Order, orders, properties = {
'userident':deferred(orders.c.user_id, group='primary'),
'description':deferred(orders.c.description, group='primary'),
l = q.select()
o2 = l[2]
print o2.opened, o2.description, o2.userident
-
+ assert o2.opened == 1
+ assert o2.userident == 7
+ assert o2.description == 'order 3'
orderby = str(orders.default_order_by()[0].compile(db))
self.assert_sql(db, go, [
("SELECT orders.order_id AS orders_order_id FROM orders ORDER BY %s" % orderby, {}),