Skip to content

Commit 1199893

Browse files
committed
README: cleanup using box() syntax #44
1 parent f516f26 commit 1199893

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,23 +61,23 @@ class Person:
6161

6262
### Using ObjectBox
6363

64-
To actually use the database, you launch (or "build") it with the model you've just defined.
65-
Afterwards, you can reuse the instance (`ob` in the example below) and use it to access "Entity Boxes" which hold your objects.
64+
To actually use the database, you create a Store with the model you've just defined.
65+
Afterwards, you can reuse the instance (`store` in the example below) and use it to access "Entity Boxes" which hold your objects.
6666

6767
#### program.py
6868

6969
```python
7070
import objectbox
7171
# from mypackage.model import Person
7272

73-
# Configure ObjectBox: should be done only once in the whole program and the "ob" variable should be kept around
73+
# Configure ObjectBox: should be done only once in the whole program and the "store" variable should be kept around
7474
model = objectbox.Model()
7575
model.entity(Person, last_property_id=objectbox.model.IdUid(10, 1010))
7676
model.last_entity_id = objectbox.model.IdUid(1, 1)
77-
store = objectbox.Store(model=model, directory="db")
77+
store = objectbox.Store(model=model)
7878

7979
# Open the box of "Person" entity. This can be called many times but you can also pass the variable around
80-
box = objectbox.Box(ob, Person)
80+
box = store.box(Person)
8181

8282
person = Person()
8383
person.name = "Joe Green"

0 commit comments

Comments
 (0)