Re: [sqlalchemy] Implementing historical tables

2018-02-01 Thread Simon King
On Wed, Jan 31, 2018 at 5:27 PM, Stanislav Lobanov wrote: > Hello, i need to create a system, that can store historical versions of > objects. > > Example model looks like: > > class User(Base): >id=Column(Integer) # ForeignKey >start=Column(DateTime) >end=Column(DateTime) >name=C

Re: [sqlalchemy] Implementing historical tables

2018-01-31 Thread Stanislav Lobanov
Thank you very much for such a quick answer, Matrin, i'll do some research on it. среда, 31 января 2018 г., 20:44:51 UTC+3 пользователь Martin Marrese написал: > > Hi Stanislav, > > Perhaps a way to avoid using `save` and `add_new` custom methods is to > rely on listeners, perhaps `after_updat

Re: [sqlalchemy] Implementing historical tables

2018-01-31 Thread Martin Marrese
Hi Stanislav, Perhaps a way to avoid using `save` and `add_new` custom methods is to rely on listeners, perhaps `after_update` and `after_insert` will let you create historical records in some place else. A couple of years ago I achieved this with SQLAlchemy Continuum (1), but I'm not sure in whi

[sqlalchemy] Implementing historical tables

2018-01-31 Thread Stanislav Lobanov
Hello, i need to create a system, that can store historical versions of objects. Example model looks like: class User(Base): id=Column(Integer) # ForeignKey start=Column(DateTime) end=Column(DateTime) name=Column(String) I have implemented .add_new() and .save() methods on base cla