Re: [sqlalchemy] How to do a revision table or How to get a 1:1 and 1:n relationship between the same tables to work properly

2015-06-18 Thread Adrian
I hadn't seen that part of the documentation - doing it that way works fine now! I ended up using a signal to update `revisions` automatically when setting `current_revision`:

Re: [sqlalchemy] How to do a revision table or How to get a 1:1 and 1:n relationship between the same tables to work properly

2015-06-18 Thread Richard Gerd Kuesters
have you taken a look at this approach? https://bitbucket.org/zzzeek/sqlalchemy/src/4a25c10e27147917e93e6893df13b2b55673e0a7/examples/versioned_history/?at=master chers, richard. On 06/18/2015 08:44 AM, Adrian wrote: I hadn't seen that part of the documentation - doing it that way works fine

Re: [sqlalchemy] How to do a revision table or How to get a 1:1 and 1:n relationship between the same tables to work properly

2015-06-17 Thread Mike Bayer
On 6/17/15 12:00 PM, Adrian wrote: I'm trying to store old versions of (some of) the data in one of my tables. To do so, I'm thinking about models like this (not including anything not relevant to the case): class EventNote(db.Model): id = db.Column(db.Integer, primary_key=True)

[sqlalchemy] How to do a revision table or How to get a 1:1 and 1:n relationship between the same tables to work properly

2015-06-17 Thread Adrian
I'm trying to store old versions of (some of) the data in one of my tables. To do so, I'm thinking about models like this (not including anything not relevant to the case): class EventNote(db.Model): id = db.Column(db.Integer, primary_key=True) latest_revision = db.relationship(