Beispiel #1
0
 def set(self, value):
     """ Set the list given a comma-separated string or a list"""
     error = None
     if value is not None:
         if not isinstance(value, list):
             value = listquote.simplelist(value)
         if self.__validation:
             error, value = self.__validation(value)
         if not error:
             self._Option__set(value)
     return error
Beispiel #2
0
 def set(self, value):
     """ Set the list given a comma-separated string or a list"""
     error = None
     if value is not None:
         if not isinstance(value, list):
             value = listquote.simplelist(value)
         if self.__validation:
             error, value = self.__validation(value)
         if not error:
             self._Option__set(value)
     return error
Beispiel #3
0
 def set_dict(self, values):
     """ Create filter list from dictionary with keys 'filter[0-9]+' """
     filters = []
     for n in xrange(len(values)):
         kw = 'filter%d' % n
         val = values.get(kw)
         if val is not None:
             val = values[kw]
             if type(val) == type([]):
                 filters.append(val)
             else:
                 filters.append(listquote.simplelist(val))
             while len(filters[-1]) < 6:
                 filters[-1].append('')
     if filters:
         self.set(filters)
     return True
Beispiel #4
0
 def set_dict(self, values):
     """ Create filter list from dictionary with keys 'filter[0-9]+' """
     filters = []
     for n in xrange(len(values)):
         kw = "filter%d" % n
         val = values.get(kw)
         if val is not None:
             val = values[kw]
             if type(val) == type([]):
                 filters.append(val)
             else:
                 filters.append(listquote.simplelist(val))
             while len(filters[-1]) < 6:
                 filters[-1].append("")
     if filters:
         self.set(filters)
     return True
Beispiel #5
0
 def set_dict(self, values):
     """ Create filter list from dictionary with keys 'filter[0-9]+' """
     filters = []
     for n in xrange(len(values)):
         kw = 'filter%d' % n
         val = values.get(kw)
         if val is not None:
             val = values[kw]
             if isinstance(val, list):
                 filters.append(val)
             else:
                 filters.append(listquote.simplelist(val))
             while len(filters[-1]) < 7:
                 filters[-1].append('1')
             if not filters[-1][6]:
                 filters[-1][6] = '1'
     if filters:
         self.set(filters)
     return True