#encoding:utf-8
from sqldb import *
class Article(Base):
__tablename__ = 'article'
id = Column(Integer, primary_key=True)
title = Column(String(50))
author = Column(String(50))
content = Column(String(12))
def __repr__(self):
return "<Article(title='%s', author='%s', content='%s')>" % (self.title, self.author, self.content)
Session = sessionmaker(bind=engine)
session = Session()
usr_info = session.query(Article).filter_by(title='1111').first()
print usr_info
from sqldb import *
class Article(Base):
__tablename__ = 'article'
id = Column(Integer, primary_key=True)
title = Column(String(50))
author = Column(String(50))
content = Column(String(12))
def __repr__(self):
return "<Article(title='%s', author='%s', content='%s')>" % (self.title, self.author, self.content)
Session = sessionmaker(bind=engine)
session = Session()
usr_info = session.query(Article).filter_by(title='1111').first()
print usr_info