#NEWLINE# @ staticmethod #NEWLINE# def _make_node_label( relation ) : #NEWLINE# #INDENT# 'Create the table layout for graph nodes\n        ' #NEWLINE# columns = list ( ) #NEWLINE# row = '<TR><TD ALIGN="left" PORT="{col_name}">{col_name}{pk}</TD></TR>' #NEWLINE# for column in sorted ( relation . columns ( ) , key = ( lambda x : x . position ) ) : #NEWLINE# #INDENT# columns . append ( row . format ( col_name = column . name , pk = ( ' (PK)' if column . primary else '' ) ) ) #NEWLINE# #UNINDENT# layout = '<<TABLE BORDER="1" CELLBORDER="0" CELLSPACING="0">\n<TR><TD BGCOLOR="lightblue">{table_name}</TD></TR>\n{columns}</TABLE>>' . format ( table_name = relation . full_name , columns = '\n' . join ( columns ) ) #NEWLINE# return layout