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-r730.zip (47.0 kB view details)

Uploaded Source

Built Distribution

ObjectStateTracer-0.1a0.dev_r730-py2.4.egg (77.7 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for ObjectStateTracer-0.1a0.dev-r730.zip
Algorithm Hash digest
SHA256 dd2ebaeff00b8a7bd9413a373c5e9f2a5b68221209eefa2ac4d38d9ecc84c559
MD5 f7a75311412905a4249e6f2618325c9f
BLAKE2b-256 69bc1513bbd75ec5961e7526e04dc5ea4fdf3ddb32fb45ac1a1e0cd891b14a97

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for ObjectStateTracer-0.1a0.dev_r730-py2.4.egg
Algorithm Hash digest
SHA256 27dcddf57c72f69a66fecb3021effcee4513f10b7c6ad8e8f1c2e6ae82c9f098
MD5 2fbba1165efeaf25e96a4a0152ed29d9
BLAKE2b-256 4791629ca83e99d8b726aad5c3aa068e4af0881090d4c7f8608e2686730a2f2e

See more details on using hashes here.

Provenance

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