Historical Version of ZODB Objects

Christopher Lozinski <[email protected]> Wed, 24 Jan 2018 00:14:06 -0800 (PST)
Newsgroups gmane.comp.web.zope.zodb
Message-ID <[email protected]>
 

There is this wonderful library for accessing historical version of ZODB 
objects.  

Dm.historical.   It makes it very easy to restore previous versions of 
objects. 


https://pypi.python.org/pypi/dm.historical/


Sadly that version does not work on Python 3.4.2, ZODB 5.3.  So I wrote to 
the author.  DM.  He was kind enough to reply promptly: 



I am mainly using Plone -- which still is on Python 2.

Therefore, I do not recognize when software from me (especially those

related to Zope/ZODB) breaks for Python 3.


I could not find a github repository.  Is it on the web somewhere?


The only repository is on my local computer: it is an old cvs repository.


Is there a newer version somewhere?

The most current version is published on PyPI.


Apparently, there is meanwhile a ZODB version conpatible with Python 3.

If you tell me what ZODB version you are using, I may take a look.


So I let him know my versions. If you are curious as to my problem, the 
error message is attached below.

...


File 
"/home/lozinski/code/cromlech/CromlechCromDemo/eggs/dm.historical-1.2-py\

3.4.egg/dm/historical/__init__.py", line 11, in <module>

  from connection import Connection, hwrap

zope.configuration.xmlconfig.ZopeXMLConfigurationError: File 
"/home/lozinski/co\

de/cromlech/CromlechCromDemo/app.zcml", line 2.2-2.32

  ZopeXMLConfigurationError: File 
"/home/lozinski/code/cromlech/CromlechCromD\

emo/src/cromdemo/src/cromdemo/configure.zcml", line 16.4-16.39

  ImportError: No module named 'connection'


Looks like something trivial: Python 3 insists on absolute imports;

"dm.historical" still uses (implicit) package local imports.


You could try to modify "from connection import ..." to

"from .connection import ..." (and maybe similar

or other package local imports as well).


 

Well I fixed that problem, but the next one raised its head. 

    from .connection import Connection, hwrap

zope.configuration.xmlconfig.ZopeXMLConfigurationError: File 
"/home/lozinski/co\

de/cromlech/CromlechCromDemo/app.zcml", line 2.2-2.32

    ZopeXMLConfigurationError: File 
"/home/lozinski/code/cromlech/CromlechCromD\

emo/src/cromdemo/src/cromdemo/configure.zcml", line 16.4-16.39

    SyntaxError: invalid syntax (connection.py, line 39)


But there may be more significant problems - related to the new

ZODB version.


I worry that the Api’s may be different. 

These lines are interesting. 

https://github.com/jimfulton/pheather/blob/master/src/pheather/__init__.py#L57


They offer a generator for history recently done.  I think one then needs 
to open a connection for each time stamp to get a particular object.  

 

Does anyone know where to find a more recent version?  Is there an 
alternative solution?  I basically want to view lhe list of historic 
versions, and restore to the one I want. 


 Warm Regards

Christopher Lozinski


https://PythonLinks.info <https://pythonlinks.info/>

tel: +48 12 361 3136

Skype: clozinski


-- 
You received this message because you are subscribed to the Google Groups "zodb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.