user_mapper = assign_mapper(ctx, User, user_table,
properties = {
'alerts': relation(Alert,
cascade="all, delete-orphan")
})
alert_mapper = assign_mapper(ctx, Alert, alert_table)
user = session["user"]
alert = model.Alert(form_result["name"])
user.alerts.append(alert)
user.save_or_update()
user.flush()
I save a User SA object in session["user"] in another page. Then, in
this page, I try to add Alert objects to the user object. I get this
exception.
<class 'sqlalchemy.exceptions.InvalidRequestError'>: Object
'<entic.models.Alert object at 0xcc2970>' is already attached to
session '13378672' (this is '12302224')
Can someone give me pointers on how I can resolve this?
Plus, are there any best practices for passing around SA mapped
objects in beaker sessions?
Thanks,
Anil
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---