list with optiondescription filter
This commit is contained in:
@ -288,18 +288,19 @@ class TiramisuOptionValue(_Value):
|
||||
class _Option:
|
||||
def list(self,
|
||||
type='option'):
|
||||
if type not in ['all', 'option']:
|
||||
raise NotImplementedError()
|
||||
if type not in ['all', 'option', 'optiondescription']:
|
||||
raise Exception('unknown list type {}'.format(type))
|
||||
for path, schema in self.schema['properties'].items():
|
||||
if type == 'all' or schema['type'] not in ['object', 'array'] and self.config.is_hidden(path, None):
|
||||
if not self.config.is_hidden(path, None):
|
||||
if schema['type'] in ['object', 'array']:
|
||||
yield TiramisuOptionDescription(self.config,
|
||||
schema,
|
||||
self.model,
|
||||
self.form,
|
||||
self.temp,
|
||||
path)
|
||||
else:
|
||||
if type in ['all', 'optiondescription']:
|
||||
yield TiramisuOptionDescription(self.config,
|
||||
schema,
|
||||
self.model,
|
||||
self.form,
|
||||
self.temp,
|
||||
path)
|
||||
elif type in ['all', 'option']:
|
||||
yield TiramisuOption(self.config,
|
||||
schema,
|
||||
self.model,
|
||||
|
Reference in New Issue
Block a user