def _get_revision_history(self, query, args, title): rows, idx = gmPG2.run_ro_queries(queries = [{'cmd': query, 'args': args}], get_col_idx = True) lines = [] lines.append(u'%s (%s versions)' % (title, rows[0]['row_version'] + 1)) if len(rows) == 1: lines.append(u'') lines.extend(format_dict_like ( rows[0], left_margin = 1, tabular = True, value_delimiters = None, eol = None )) return lines for row_idx in range(len(rows)-1): lines.append(u'') row_older = rows[row_idx + 1] row_newer = rows[row_idx] lines.extend(format_dict_likes_comparison ( row_older, row_newer, title_left = _('Revision #%s') % row_older['row_version'], title_right = _('Revision #%s') % row_newer['row_version'], left_margin = 0, key_delim = u' | ', data_delim = u' | ', missing_string = u'', ignore_diff_in_keys = ['audit__action_applied', 'audit__action_when', 'audit__action_by', 'pk_audit', 'row_version', 'modified_when', 'modified_by'] )) return lines
def format_loinc(loinc): data = loinc2data(loinc) if data is None: return None return gmTools.format_dict_like(dict(data), tabular=True, value_delimiters=None, values2ignore=[None, ''])
def format_loinc(loinc): data = loinc2data(loinc) if data is None: return None return gmTools.format_dict_like ( data, tabular = True, value_delimiters = None, values2ignore = [None, ''] )
def format(self, *args, **kwargs): return format_dict_like ( self.fields_as_dict(none_string = '<?>'), tabular = True, value_delimiters = None ).split('\n')
def format(self, *args, **kwargs): """Return instance data generically formatted as a table.""" return format_dict_like(self.fields_as_dict(none_string='<?>'), tabular=True, value_delimiters=None).split('\n')