<s> from sqlalchemy import Column , Integer , String , ForeignKey <EOL> from sqlalchemy . ext . declarative import declarative_base <EOL> from sqlalchemy . orm import relationship <EOL> from eralchemy import render_er <EOL> Base = declarative_base ( ) <EOL> class Parent ( Base ) : <EOL> __tablename__ = '<STR_LIT>' <EOL> id = Column ( Integer , primary_key = True ) <EOL> name = Column ( String ( <NUM_LIT:255> ) ) <EOL> class Child ( Base ) : <EOL> __tablename__ = '<STR_LIT>' <EOL> id = Column ( Integer , primary_key = True ) <EOL> parent_id = Column ( ForeignKey ( '<STR_LIT>' ) ) <EOL> parent = relationship ( '<STR_LIT>' , backref = '<STR_LIT>' ) <EOL> def example ( ) : <EOL> render_er ( Base , '<STR_LIT>' ) <EOL> render_er ( Base , '<STR_LIT>' ) <EOL> render_er ( Base , '<STR_LIT>' ) <EOL> render_er ( Base , '<STR_LIT>' ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> example ( ) </s>
