terrasea/Python-OAuth-2.0-Provider — Issue #2: database updates don't work
Author: terrasea
Created: 2012-02-06 00:41:11+00:00
State: open

In the ZODB class in DB.py there is a update method. It has two parameters passed to it, the key and the actual data. If the data is a object the inherits from ZODBs Persistent class, it will set data._p_changed to True. It was assumed that the data was passed by reference, so any changes done here would be present in the object in the caller function. This seems not to be the case. If you set _p_changed to True in the update method, the objects _p_changed in the caller will still be False. The obvious quick fix is to set the _p_changed to True in the caller function, but this is not desired. It does not even update if you pass the values to be changed to the update method and do the commit there. A way of using update needs to be found so the code can change databases with as little refactoring as possible.