def write_table_comment(self, meta): try: comment = normalize_comment( get_comment(meta, '', meta.verbose_name)) self.execute_sql(u"COMMENT ON TABLE %s IS '%s'" % (meta.db_table, comment)) except Exception as e: print(e)
def write_fields_comment(self, meta): for field in meta.concrete_fields: try: if str(meta.model) == str(field.model): comment = normalize_comment(get_comment(meta, field.column, field.verbose_name)) self.execute_sql(u"COMMENT ON COLUMN %s.%s IS '%s'" % (meta.db_table, field.column, comment)) except Exception as e: print (e)
def write_fields_comment(self, meta): for field in meta.concrete_fields: try: if str(meta.model) == str(field.model): comment = normalize_comment( get_comment(meta, field.column, field.verbose_name)) self.execute_sql(u"COMMENT ON COLUMN %s.%s IS '%s'" % (meta.db_table, field.column, comment)) except Exception as e: print(e)
def field_comment(meta, field): return mark_safe(get_comment(meta, field.column, field.verbose_name))
def table_comment(meta): return get_comment(meta, '', meta.verbose_name)
def write_table_comment(self, meta): try: comment = normalize_comment(get_comment(meta, '', meta.verbose_name)) self.execute_sql(u"COMMENT ON TABLE %s IS '%s'" % (meta.db_table, comment)) except Exception as e: print (e)