changed a lot regarding rec state, etc.

This commit is contained in:
Tobias Kurze
2019-12-03 16:05:02 +01:00
parent a709dbcaef
commit 190f728eb7
13 changed files with 369 additions and 831 deletions

View File

@@ -0,0 +1,11 @@
class ModelBase:
def get(self, attribute_name, default_value=None):
if hasattr(self, attribute_name):
return getattr(self, attribute_name)
elif False: # a check for properties?
pass
elif default_value is not None:
return default_value
else:
raise KeyError("{} not found".format(attribute_name))