예제 #1
0
 def list_types(self):
     return dumps([{t: types[t].label} for t in types.keys()])
예제 #2
0
 def columns(self):
     if not self._cols:
         cols = self.document.META.property('type', 'columns')
         columns = []
         if not cols:
             columns = [
                        {'rel': '%s.%s'%(self.document.META.doc_tablename, df.df_name), 
                         'label': df.df_label, 'class': df.df_type,
                         'style': '' if df.property("policy", "is_readable")!="NEVER" else 'hide' } for df in self.document.META.DOC_FIELDS if df.df_type in types.keys() and df.property('policy', 'is_readable')!="NEVER"]
         else:
             for col in cols:
                 df = self.document.META.get_doc_field(col)
                 columns.append({'rel': df.df_name, 'label': df.df_label})
         self._cols = columns
     return self._cols
예제 #3
0
 def set_validators(self):
     self.validators = {
         'df_name': IS_NOT_EMPTY(),
         'df_type': IS_IN_SET(types.keys()),
     }