mirror of
https://github.com/yweber/lodel2.git
synced 2025-11-01 03:59:02 +01:00
Added new properties and the check_options method to the DataHandler class
This commit is contained in:
parent
7a1416ee21
commit
c2f62bce50
1 changed files with 12 additions and 0 deletions
|
|
@ -30,6 +30,9 @@ class DataHandler(object):
|
|||
__custom_handlers = dict()
|
||||
|
||||
help_text = 'Generic Field Data Handler'
|
||||
display_name = "Generic Field"
|
||||
options_spec = dict()
|
||||
options_values = dict()
|
||||
|
||||
##@brief List fields that will be exposed to the construct_data_method
|
||||
_construct_datas_deps = []
|
||||
|
|
@ -57,6 +60,15 @@ class DataHandler(object):
|
|||
del(kwargs['default'])
|
||||
for argname, argval in kwargs.items():
|
||||
setattr(self, argname, argval)
|
||||
self.check_options()
|
||||
|
||||
def check_options(self):
|
||||
for option_name, option_value in self.options_values.items():
|
||||
self.options_values[option_name] = self.options_spec[option_name].check_value(option_value)
|
||||
|
||||
@property
|
||||
def options(self):
|
||||
return self.options_values
|
||||
|
||||
## Fieldtype name
|
||||
@classmethod
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue