Comments (7)
I hacked a naive plugin that adds related by foreign key objects into the current versioning transaction. The code is not tested and probably contain bugs. It also probably contains assumptions that are only true in my models. There are no unit tests.
https://gist.github.com/grakic/66006440ed871c8b9d73a2206dff8a5e
From some simple playing in the shell, it looks like it is working. I will keep working on this as time permits.
from sqlalchemy-continuum.
I would really like some feedback on this one by @kvesteri . Is the issue clear or should I describe it more in detail?
from sqlalchemy-continuum.
This kind of functionality can be emulated with TransactionMeta. I'm going to update the docs for how to use it.
from sqlalchemy-continuum.
The next version of Continuum has a plugin architecture where you could create a plugin for local versions. Also the new Activity plugin offers means for handling local histories.
from sqlalchemy-continuum.
Hello all, any news on incrementing object version when its relations change ? If no, is there any workaround documented ?
from sqlalchemy-continuum.
It would be nice if this limitation was at least explicitly mentioned in the documentation related to relationships, the last place I expected to have to look to find a (sort of) solution to what appears to be a bug is in the plugin section! Given that both versions and relationships are expressed in the object model itself, the changes to the relationships should certainly affect the version. It makes sense to expect that given the intent of abstracting the underlying tables to an object model. And it appears to be a bug as the version of the relationships themselves is being incremented (as visible in the database tables) but there is no obvious way to see the versions of a relationship, because you are expected to access them via the object property of the parent (and/or child).
from sqlalchemy-continuum.
@grakic plugin works great with some changes to fit our code
I hacked a naive plugin that adds related by foreign key objects into the current versioning transaction. The code is not tested and probably contain bugs. It also probably contains assumptions that are only true in my models. There are no unit tests.
https://gist.github.com/grakic/66006440ed871c8b9d73a2206dff8a5e
From some simple playing in the shell, it looks like it is working. I will keep working on this as time permits.
from sqlalchemy-continuum.
Related Issues (20)
- when autocommit isolation mode used, rollback at transaction level is not resulting in rollback of continuum transactions HOT 7
- how to get the version of a set of object at a given point in time / transaction id HOT 1
- AttributeError: '_ProxyImpl' object has no attribute 'dispatch' at configure_mappers step (sqlalchemy v2.0)
- 'enable_active_history' should exclude synonyms. SQLAlchemy 2.0 support issue
- Flask SQLAlchemy Binds support HOT 4
- Updates for SQLAlchemy >= 2.0.22 HOT 10
- Add support for computed fields HOT 4
- SQLAlchemy Continuum tries to add empty rows to the database HOT 2
- Changeset doesn't gather changes in many-to-many relationships HOT 2
- Support MariaDB triggers
- sqlalchemy.exc.SADeprecationWarning on from sqlalchemy_continuum import make_versioned with sqlalchemy > 2 HOT 2
- No version for one to many relationships. HOT 1
- Support for application time periods
- Pytest fails with `sqlalchemy.exc.UnboundExecutionError: This session is not bound to a single Engine or Connection, and no context was provided to locate a binding.` HOT 3
- Support for index definition in version table
- Patch or Minor Version for a7a6bd7 & ccd8707 HOT 4
- Incompatibility with version 1.4 and SQLAlchemy<2 HOT 2
- Remove dependency on sqlalchemy-utils
- `version.changeset` vs `changeset(obj)` order consistency
- Versioned tables with Relationship loading techniques
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqlalchemy-continuum.