I am starting to use session and units of work.
I am look for a way to have queries load the records result set to be
used and update the identity map with the new data just as if a expire
had been done for each record in the results set but not expire/refresh
records not in the results set for the select.
I want the objects attributes that match the database columns to updated
but not touch the attributes that I have added. I have added
observer/notify protocol to the object being mapped. I want the observer
of the object to still be there after the row attributes
have been updated.
I have created a super class that all the data mapper class should use
to get the extra function.
class ActiveMap(object):
def register(self, tag, function, **kwargs):
if not hasattr(self, '__observers'):
self.__observers = observers()
self.__observers.register(tag, function, **kwargs)
def notify(self, tag, **kwargs):
self.__observers.notify(tag, data=self)
def __setitem__(self, name, value):
return setattr(self, name, value)
def __getitem__(self, name):
return getattr(self, name)
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users