Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Commit 7ddd765

Browse files
committed
Fix indexed & index_by properties
1 parent adb5c4b commit 7ddd765

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

orbitdbapi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.1.0.rc.1.dev9'
1+
__version__ = '0.1.0.rc.2.1'

orbitdbapi/db.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ def __init__(self, client, params, **kwargs):
1010
self.__cache = {}
1111
self.__client = client
1212
self.__params = params
13+
self.__db_options = params.get('options', {})
1314
self.__dbname = params['dbname']
1415
self.__id = params['id']
1516
self.__id_safe = urlquote(self.__id, safe='')
@@ -19,7 +20,7 @@ def __init__(self, client, params, **kwargs):
1920
self.__enforce_indexby = kwargs.get('enforce_indexby', True)
2021

2122
self.logger = logging.getLogger(__name__)
22-
self.__index_by = self.index_by
23+
self.__index_by = self.__db_options.get('indexBy')
2324

2425

2526
def clear_cache(self):
@@ -36,7 +37,7 @@ def cache_remove(self, item):
3637

3738
@property
3839
def index_by(self):
39-
return self.__params.get('indexBy')
40+
return self.__index_by
4041

4142
@property
4243
def cache(self):
@@ -83,7 +84,7 @@ def incrementable(self):
8384

8485
@property
8586
def indexed(self):
86-
return 'indexBy' in self.__params
87+
return 'indexBy' in self.__db_options
8788

8889
def info(self):
8990
endpoint = '/'.join(['db', self.__id_safe])

0 commit comments

Comments
 (0)