<s> """<STR_LIT>""" <EOL> import web <EOL> from sqlalchemy import Column , Integer , String , ForeignKey <EOL> from sqlalchemy . orm import relationship <EOL> from sqlalchemy . ext . declarative import declarative_base <EOL> from social . utils import setting_name , module_member <EOL> from social . storage . sqlalchemy_orm import SQLAlchemyUserMixin , SQLAlchemyAssociationMixin , SQLAlchemyNonceMixin , SQLAlchemyCodeMixin , BaseSQLAlchemyStorage <EOL> SocialBase = declarative_base ( ) <EOL> UID_LENGTH = web . config . get ( setting_name ( '<STR_LIT>' ) , <NUM_LIT:255> ) <EOL> User = module_member ( web . config [ setting_name ( '<STR_LIT>' ) ] ) <EOL> class WebpySocialBase ( object ) : <EOL> @ classmethod <EOL> def _session ( cls ) : <EOL> return web . db_session <EOL> class UserSocialAuth ( WebpySocialBase , SQLAlchemyUserMixin , SocialBase ) : <EOL> """<STR_LIT>""" <EOL> uid = Column ( String ( UID_LENGTH ) ) <EOL> user_id = Column ( Integer , ForeignKey ( User . id ) , <EOL> nullable = False , index = True ) <EOL> user = relationship ( User , backref = '<STR_LIT>' ) <EOL> @ classmethod <EOL> def username_max_length ( cls ) : <EOL> return User . __table__ . columns . get ( '<STR_LIT:username>' ) . type . length <EOL> @ classmethod <EOL> def user_model ( cls ) : <EOL> return User <EOL> class Nonce ( WebpySocialBase , SQLAlchemyNonceMixin , SocialBase ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class Association ( WebpySocialBase , SQLAlchemyAssociationMixin , SocialBase ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class Code ( WebpySocialBase , SQLAlchemyCodeMixin , SocialBase ) : <EOL> pass <EOL> class WebpyStorage ( BaseSQLAlchemyStorage ) : <EOL> user = UserSocialAuth <EOL> nonce = Nonce <EOL> association = Association <EOL> code = Code </s>
