Skip to content

Commit c44c759

Browse files
committed
store: added box() #44
1 parent 8e1717d commit c44c759

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

objectbox/store.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import objectbox.transaction
1818
from objectbox.store_options import StoreOptions
1919
import objectbox
20+
from objectbox.model.entity import _Entity
2021
from typing import *
2122

2223
class Store:
@@ -170,6 +171,15 @@ def __init__(self,
170171

171172
def __del__(self):
172173
self.close()
174+
175+
def box(self, entity: _Entity) -> 'objectbox.Box':
176+
"""
177+
Open a box for an entity.
178+
179+
:param entity:
180+
Entity type of the model
181+
"""
182+
return objectbox.Box(self, entity)
173183

174184
def read_tx(self):
175185
return objectbox.transaction.read(self)

0 commit comments

Comments
 (0)