<s> """<STR_LIT>""" <EOL> import datetime <EOL> from sqlalchemy import Column , Integer , String , DateTime , ForeignKey <EOL> from sqlalchemy . ext . declarative import declarative_base <EOL> from sqlalchemy . orm import relationship , backref <EOL> from sqlalchemy . ext . hybrid import hybrid_property <EOL> Base = declarative_base ( ) <EOL> class User ( Base ) : <EOL> """<STR_LIT>""" <EOL> __tablename__ = '<STR_LIT>' <EOL> id = Column ( Integer , primary_key = True ) <EOL> name = Column ( String , unique = True ) <EOL> created_at = Column ( DateTime , default = datetime . datetime . utcnow ) <EOL> address = relationship ( '<STR_LIT>' , uselist = False , backref = backref ( '<STR_LIT:user>' ) ) <EOL> def __unicode__ ( self ) : <EOL> """<STR_LIT>""" <EOL> return '<STR_LIT:%s>' % self . name <EOL> def __repr__ ( self ) : <EOL> """<STR_LIT>""" <EOL> return '<STR_LIT>' % ( self . __class__ . __name__ , self . id ) <EOL> @ hybrid_property <EOL> def dummy ( self ) : <EOL> return '<STR_LIT>' % ( self . name [ <NUM_LIT:0> : <NUM_LIT:1> ] , str ( self . id ) ) <EOL> @ dummy . expression <EOL> def dummy ( cls ) : <EOL> return True <EOL> class Address ( Base ) : <EOL> """<STR_LIT>""" <EOL> __tablename__ = '<STR_LIT>' <EOL> id = Column ( Integer , primary_key = True ) <EOL> description = Column ( String , unique = True ) <EOL> user_id = Column ( Integer , ForeignKey ( '<STR_LIT>' ) ) <EOL> def __unicode__ ( self ) : <EOL> """<STR_LIT>""" <EOL> return '<STR_LIT:%s>' % ( self . id ) <EOL> def __repr__ ( self ) : <EOL> """<STR_LIT>""" <EOL> return '<STR_LIT>' % ( self . __class__ . __name__ , self . id ) </s>
