Skip to main content

Traces SQLObject and SQLAlcemy object modifications

Project description

The idea is to provide a modification history in a transparent way.

I'm experimenting with SQLObject right now. SQLAlchemy support is not in yet.

When it's enabled it intercepts __setattr__ and the .set() method and tracs the
modifications on it's own table.

It adds a method to the SQLObject instances called get_modification_history()
that will return a list of ObjectStateTrace instances.

This object has 4 key attributes:
* time: moment the modification happened
* column_name: it is the attribute changed in the SQLObject instance
* old_value: value before the change
* new_value: value after the change

To enable this extension add this to your config file:
objectstatetracer.on=True

To use it:
class YourClass(SQLObject)
....

from objectstatetracer.extension import register_class

register_class(YourClass)

And the instances of YourClass should be audited for changes.

I couldn't add the WidgetDescription of HistoryPanel (a datagrid that shows the
modifications), because it's far from being finished.

Check the tests for more info.

IT DOES NOT SUPPORT LAZY UPDATES YET

!!!HIGHLY EXPERIMENTAL!!!
Right now this may break your software and/or corrupt your data.
Use at your own risk!.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ObjectStateTracer-0.1a0.dev-r713.zip (46.3 kB view details)

Uploaded Source

Built Distribution

ObjectStateTracer-0.1a0.dev_r713-py2.4.egg (75.7 kB view details)

Uploaded Source

File details

Details for the file ObjectStateTracer-0.1a0.dev-r713.zip.

File metadata

File hashes

Hashes for ObjectStateTracer-0.1a0.dev-r713.zip
Algorithm Hash digest
SHA256 6a9e07b5b8fbf4a0183a2e1422600f710f447e675a6c6a4e3d27398463448df2
MD5 b1d874f0b816c4bd918cbd2c6919da4a
BLAKE2b-256 6824d7737dc0d37dec622c6838d5539b3c37306d036969d8a12e05c04d99838a

See more details on using hashes here.

File details

Details for the file ObjectStateTracer-0.1a0.dev_r713-py2.4.egg.

File metadata

File hashes

Hashes for ObjectStateTracer-0.1a0.dev_r713-py2.4.egg
Algorithm Hash digest
SHA256 d777f0e4dd52bd46799548edfd7f8a45d5ac58b32aec657f65e6b86415f299f4
MD5 2006d302c68078dfa94cf7eaba229b53
BLAKE2b-256 7b0b68c1c8c3a41d109bf3c773adce19a32f59dd7130d7b2470a6c66b1a87c78

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page