pydon, niedziela 13 września 2009 11:53:
> I certainly hope it's me being complete dumb so I can kick myself but
> lets say I want to update my username for instance. I change the data
> for the User object in the 'REMOTE_USER' session and then commit the
> object to the database. (or at least I try that)
>
> The moment I change the User object in the session and try committing
> or reading the session again it gives ->
> AttributeError: 'NoneType' object has no attribute 'commit'
This is because Session.add() returns None.
You should:
meta.Session.add(stuff)
meta.Session.commit()
BTA you shouldn't store SQLAlchemy objects in the (Beaker) session. These
objects become unusable since the (SA) Session these objects are bound to is
destroyed between requests.
A solution would be to store user's id in the session and then pull the
corresponding User object from the Session when needed.
.pk.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---