We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f94d1e4 commit 46628e7Copy full SHA for 46628e7
objectbox/model/entity.py
@@ -68,6 +68,13 @@ def __call__(self, **properties):
68
setattr(object_, prop_name, prop_val)
69
return object_
70
71
+ def __getattr__(self, name):
72
+ """ Overload to get properties via "<Entity>.<Prop>" notation. """
73
+ for prop in self.properties:
74
+ if prop._name == name:
75
+ return prop
76
+ return self.__getattribute__(name)
77
+
78
def fill_properties(self):
79
# TODO allow subclassing and support entities with __slots__ defined
80
variables = dict(vars(self.user_type))
0 commit comments