Commit 4b1dfa88 authored by Matias Guijarro's avatar Matias Guijarro

config/settings.py: added .name property for all settings

parent 00e29b82
......@@ -149,6 +149,10 @@ class SimpleSetting(object):
self._write_type_conversion = write_type_conversion
self._default_value = default_value
@property
def name(self):
return self._name
@read_decorator
def get(self):
cnx = self._cnx()
......@@ -229,6 +233,10 @@ class SimpleSettingProp(object):
self._default_value = default_value
self._use_object_name = use_object_name
@property
def name(self):
return self._name
def __get__(self, obj, type=None):
if self._use_object_name:
name = obj.name + ':' + self._name
......@@ -267,6 +275,10 @@ class QueueSetting(object):
self._read_type_conversion = read_type_conversion
self._write_type_conversion = write_type_conversion
@property
def name(self):
return self._name
@read_decorator
def get(self, first=0, last=-1, cnx=None):
if cnx is None:
......@@ -406,6 +418,10 @@ class QueueSettingProp(object):
self._write_type_conversion = write_type_conversion
self._use_object_name = use_object_name
@property
def name(self):
return self._name
def __get__(self, obj, type=None):
if self._use_object_name:
name = obj.name + ':' + self._name
......@@ -444,6 +460,10 @@ class HashSetting(object):
self._write_type_conversion = write_type_conversion
self._default_values = default_values
@property
def name(self):
return self._name
def __repr__(self):
value = self.get_all()
return '<HashSetting name=%s value=%s>' % (self._name, value)
......@@ -607,6 +627,10 @@ class HashSettingProp(object):
self._default_values = default_values
self._use_object_name = use_object_name
@property
def name(self):
return self._name
def __get__(self, obj, type=None):
if self._use_object_name:
name = obj.name + ':' + self._name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment