added self.config to the properties

This commit is contained in:
gwen 2019-02-08 11:24:29 +01:00
parent bec906cd54
commit 05168ca5d0
1 changed files with 3 additions and 0 deletions

View File

@ -113,6 +113,7 @@ class TiramisuOptionOption:
class TiramisuOptionProperty:
# config.option(path).property
def __init__(self,
self.config,
path: str,
model: Dict) -> None:
self.path = path
@ -327,6 +328,7 @@ class TiramisuOptionDescription(_Option):
self.form)
if subfunc == 'property':
return TiramisuOptionProperty(self.path,
self.config,
self.model.get(self.path, {}))
if subfunc == 'value':
return TiramisuOptionValue(self.config,
@ -396,6 +398,7 @@ class TiramisuOption:
if self.index != None:
raise NotImplementedError()
return TiramisuOptionProperty(self.path,
self.config,
self.model.get(self.path, {}))
raise APIError(_('please specify a valid sub function ({})').format(subfunc))