Hi All,
I have a JSON field that's value is usually a dictionary:
class MyModel(Base):
config = Column(JSONType(255))
(Does SA have a JSONType now? we're using a homebrew one, that may be
where the problem lies...)
So, if I do:
obj = session.query(MyModel).one()
obj.config['foo'] += 1
session.commit()
...on my dev machine, the change gets persisted.
Of course, on production machines, it does not :-(
The change I seem to need is:
config = dict(obj.config)
config['foo'] += 1
obj.config = config
Is there a better way?
cheers,
Chris
--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" 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/sqlalchemy?hl=en.