<s> '''<STR_LIT>''' <EOL> from sqlalchemy . types import Unicode , Integer <EOL> from sqlalchemy import Column , ForeignKey <EOL> from models import dbsession <EOL> from models . BaseObject import BaseObject <EOL> class Permission ( BaseObject ) : <EOL> '''<STR_LIT>''' <EOL> permission_name = Column ( Unicode ( <NUM_LIT:64> ) , nullable = False ) <EOL> user_id = Column ( Integer , ForeignKey ( '<STR_LIT>' ) , nullable = False ) <EOL> @ classmethod <EOL> def by_user_id ( cls , user_id ) : <EOL> '''<STR_LIT>''' <EOL> return dbsession . query ( cls ) . filter_by ( user_id = user_id ) . all ( ) <EOL> def __repr__ ( self ) : <EOL> return ( '<STR_LIT>' % ( self . permission_name , self . user_id ) ) . encode ( '<STR_LIT:utf-8>' ) <EOL> def __unicode__ ( self ) : <EOL> return self . permission_name </s>
