Hi,
In 0.1, I could create mapped object instances from a resultset cursor using
MyMapper.instances(curs) where MyMapper was not the primary mapper.
Note: MyMapper contains a lazy 1-1 relation to another class.
In 0.2, I fix up my mapper to add entity_name (because it was
complaining), yet when I call the new MyMapper.instances(curs, session)
it spits the dummy.
[/home/huy/apps/sqlalchemy/lib/sqlalchemy/orm/properties.py:333]
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _
def setup_loader(self, instance):
# make sure our parent mapper is the one thats assigned to this
instance, else call that one
if not self.localparent.is_assigned(instance):
# if no mapper association with this instance (i.e. not in a
session, not loaded by a mapper),
# then we cant set up a lazy loader
if not mapper.has_mapper(instance):
return None
else:
E return
mapper.object_mapper(instance).props[self.key].setup_loader(instance)
> KeyError: 'status'
it seems to try to map my resultset to the primary mapper because
"status" is a lazy relation in the primary mapper.
Any ideas ?
Many Thanks,
Huy
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users