def list_types(self): return dumps([{t: types[t].label} for t in types.keys()])
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
def set_validators(self): self.validators = { 'df_name': IS_NOT_EMPTY(), 'df_type': IS_IN_SET(types.keys()), }