changed a lot regarding rec state, etc.
This commit is contained in:
11
backend/models/model_base.py
Normal file
11
backend/models/model_base.py
Normal 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))
|
||||
Reference in New Issue
Block a user