Miserlou / NoDB

NoDB isn't a database.. but it sort of looks like one.
https://blog.zappa.io/posts/introducing-nodb-pythonic-data-store-s3
380 stars 45 forks source link

bug #37

Open mxd008 opened 3 years ago

mxd008 commented 3 years ago

Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

from nodb import NoDB nodb = NoDB("my-s3-bucket") Traceback (most recent call last): File "", line 1, in TypeError: NoDB() takes no arguments nodb = NoDB('my-s3-bucket') Traceback (most recent call last): File "", line 1, in TypeError: NoDB() takes no arguments nodb = NoDB() nodb.index = "name" user = {"name": "Jeff", "age": 19} nodb.save(user) Traceback (most recent call last): File "", line 1, in File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\nodb__init.py", line 63, in save real_index = self._get_object_index(obj, self.index) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\nodb\init__.py", line 241, in _get_object_index if obj.has_key(index): AttributeError: 'dict' object has no attribute 'has_key'

nephlm commented 3 years ago

I'm not sure which version you're running,but the current version of the code in the master branch has resolved that issue. I believe it's been fixed since version 0.4.0.