jsondb icon indicating copy to clipboard operation
jsondb copied to clipboard

README describes `.save` method but no such method exists

Open talwrii opened this issue 8 years ago • 2 comments

Repro:

ipython
Python 2.7.12 (default, Jun 29 2016, 08:18:26)
Type "copyright", "credits" or "license" for more information.

IPython 2.4.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.
[TerminalIPythonApp] WARNING | File not found: '/home/tom/.pythonrc.py'

In [1]: import jsondb

In [2]: jsondb.create({}, url='/tmp/test.db')
Out[2]: <jsondb.JsonDB at 0x7f8679400290>

In [3]: d = _

In [4]: d.save()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-7e84cd160ba3> in <module>()
----> 1 d.save()

/home/tom/.local/lib/python2.7/site-packages/jsondb/core.pyc in __getattr__(self, name)
     92         cls = self.get_datatype()
     93         try:
---> 94             attr = getattr(cls, name)
     95         except:
     96             raise

AttributeError: type object 'dict' has no attribute 'save'

In [5]: print jsondb.version
0.1.2

talwrii avatar Aug 11 '16 21:08 talwrii

Confirmed. Cannot believe that the save method` was never actually implemented :( Sorry for the inconvenience.

shaung avatar Aug 23 '16 07:08 shaung

commit method can be used to save changes.

directrix1 avatar Jan 12 '19 07:01 directrix1