Skip to content

Commit 2d4b7c3

Browse files
committed
fix: correct entity field syntax in README code example (#10)
Fields Id and String require parentheses when used as class attributes. Without `Id()` and `String()`, instantiating the entity with keyword arguments raises a TypeError at runtime. Fixes #10
1 parent 9b38d97 commit 2d4b7c3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ from objectbox import Entity, Id, Store, String
4747

4848
@Entity()
4949
class Person:
50-
id = Id
51-
name = String
50+
id = Id()
51+
name = String()
5252

5353
# The ObjectBox Store represents a database; keep it around...
5454
store = Store()

0 commit comments

Comments
 (0)