On 29 loka, 09:08, [EMAIL PROTECTED] wrote: > > I dont need history tracking, just revert documents to older ones. > > that is history, just not timed history.
Most optimal would it be, if i can make rows with updated fields only, not to copy whole row... but im afraid setting unchanged field to None would be problematic when retrieving versions. I should retrieve several rows and collect the latest not None fields... just pondering > u'll have documents, and then for each document a bunch of versions.> Once > get it working on simple form, then perhaps trying optimicing > > and feeding only field, that has changed. Version field automatic > > update was on my mind lately. Could it be something like this: > > > Column("version", Integer, default=1, nullable=False, > > onupdate=document_versions.select(document_versions.document_id=c.d > >ocument_id, order_by=version, order=DESC, limit=1) > > no idea, what this onupdate is expected to do here? It was meant to be oninsert, not onupdate, but on the other hand, if making system with mapper extension, i think i need to do before_update and increase version number there as well as making a new insert and halt doing update. > afaik these things are done with a mapper extension, but i'm not sure > its the only way. I'm going to try with mapper extension > what would be version field? something that counts the inserts for > that particular document_id? Yes, just a counter for every insert to document_id. I could use len(Versions) or get latest DocumentVersion.version+1 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---