oh MAN.....

well, this is just great.

if I just add the attribute dictionary to the object, it creates circular references, then people complain that their objects dont get removed from the identity map when they fall out of scope.

if I remove the circular reference by using a weakref, now Pickle doesnt work.

it looks like im going to have to go back to the old way, where the so-called "magic" (its just a dictionary stored at obj._managed_attributes) is mapped to objects via a separate weak key dictionary somewhere.

I just found a quick way to stick that on, I think rev 1259 should solve the issue.


On Apr 6, 2006, at 4:28 AM, HD Mail wrote:

Hi,

I use to save one of my model objects in the myghty session (User object).

This no longer works after updating to the lastest svn.

I'm assuming that weakref usage is causing this which is all fine.

Is there a way to remove all SA magic stuff from my objects after SA has loaded it from the db.

So I can still do eg.

user = User.select_by(login='mylogin', password='mypassword')
objectstore.worry_not_about(user)

Which leaves my user object as a simple python object with attributes and nothing else.

This is also useful because I would like to use my model objects as DTO or parameter objects to methods but don't want SA to think that changes to it should be persisted.

Thanks

Huy


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel? cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to