trace your model field change log
Project description
sqlatracker
Inspired by django-field-history
Example
from sqlalchemy import BigInteger, Column
from sqlalchemy.ext.declarative import as_declarative
from sqlatracker.field_tracker import FieldTracker
@as_declarative()
class Base:
id = Column(BigInteger, primary_key=True, autoincrement=True)
class Example(Base):
example_field_1 = Column(BigInteger)
example_field_2 = Column(BigInteger)
FieldTracker.listen_for(
Example.example_field_1,
Example.example_field_2,
)
Integrate with your metadata for alembic
from sqlatracker.field_tracker import FieldTracker
from sqlatracker.utils import merge_metadata
target_metadata = merge_metadata(your_metadata, FieldTracker.metadata)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
sqlatracker-0.0.7.tar.gz
(5.7 kB
view hashes)
Built Distribution
Close
Hashes for sqlatracker-0.0.7-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f560199aafb817655db7723395ac4c41a276a9e2186c3963a9522b8ce63adcb4 |
|
MD5 | 7b7e916efbdc2a5871c4f80c11fcd25b |
|
BLAKE2b-256 | aab2560c2a38e1fd77932c32616a74a8fa46dd5853916d592f86cdaa3074b1ab |