本文整理汇总了Python中comcenter.model.DBSession.query方法的典型用法代码示例。如果您正苦于以下问题:Python DBSession.query方法的具体用法?Python DBSession.query怎么用?Python DBSession.query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类comcenter.model.DBSession
的用法示例。
在下文中一共展示了DBSession.query方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: listGroupUser
# 需要导入模块: from comcenter.model import DBSession [as 别名]
# 或者: from comcenter.model.DBSession import query [as 别名]
def listGroupUser(self,**kw):
groups = DBSession.query(Group).all();
self.listgroup = [];
for group in groups:
self.listgroup.append({'id' : group.group_id ,
'name' : group.group_name
});
return dict(root = self.listgroup,total=str(len(self.listgroup)));
示例2: showProgramClinicReport
# 需要导入模块: from comcenter.model import DBSession [as 别名]
# 或者: from comcenter.model.DBSession import query [as 别名]
def showProgramClinicReport(cls,startDate, stopDate,book_type,bookSearch,offset=0,limit=15):
query = DBSession.query(cls).filter( and_( cls.activate == '1', and_( cls.book_detail.like(bookSearch) ,and_( cls.book_type_id == book_type ,cls.book_recive.between(startDate, stopDate) ) )) );
count = query.count();
list = query.order_by(desc(cls.book_number)).limit(limit).offset(offset).all();
#DBSession.query(cls).filter(between(cls.book_recive, startDate, stopDate)).all();
print count ;
return count, list;
示例3: search
# 需要导入模块: from comcenter.model import DBSession [as 别名]
# 或者: from comcenter.model.DBSession import query [as 别名]
def search(cls,fiscalyear = None, group= None, subgroup= None):
sql = "1=1 ";
if (fiscalyear):
sql = sql + " and fiscal_year = " + fiscalyear;
if(group):
sql = sql + " and revenue_list_id = " + group;
if(subgroup):
sql = sql + " and revenue_sub_list_id = " + subgroup;
log.info(sql);
return DBSession.query(cls).filter(sql).all();
示例4: listUser
# 需要导入模块: from comcenter.model import DBSession [as 别名]
# 或者: from comcenter.model.DBSession import query [as 别名]
def listUser(self,**kw):
#users = DBSession.query(User).all();
groups = DBSession.query(Group).all();
self.list = [];
for group in groups:
for guser in group.users:
self.list.append({'id' : guser.user_id ,
'name' : guser.user_name,
'display' : guser.display_name,
'email' : guser.email_address,
'group_id' : group.group_id,
'group' : group.group_name
});
return dict(root = self.list,total=str(len(self.list)));
示例5: search
# 需要导入模块: from comcenter.model import DBSession [as 别名]
# 或者: from comcenter.model.DBSession import query [as 别名]
def search(cls,fiscalyear=None,division=None,section=None,status=None,projectType=None,start=0,limit=25):
sql = "1=1 ";
if (fiscalyear):
sql = sql + " and fiscal_year = " + fiscalyear;
if(projectType):
sql = sql + " and project_type_id = " + projectType;
if(division):
sql = sql + " and division_id = " + division;
if(section):
sql = sql + " and section_id = " + section;
if(status):
sql = sql + " and project_status_id = " + status ;
log.info(sql);
return DBSession.query(cls).filter(sql).all();
示例6: listPrimarySchool
# 需要导入模块: from comcenter.model import DBSession [as 别名]
# 或者: from comcenter.model.DBSession import query [as 别名]
def listPrimarySchool(cls):
return DBSession.query(cls).filter( cls.high_school==str(0) ).order_by(cls.school_id).all();
示例7: listAll
# 需要导入模块: from comcenter.model import DBSession [as 别名]
# 或者: from comcenter.model.DBSession import query [as 别名]
def listAll(cls):
return DBSession.query(cls).order_by(cls.dental_child_dev_center_service_id).all();
示例8: by_email_address
# 需要导入模块: from comcenter.model import DBSession [as 别名]
# 或者: from comcenter.model.DBSession import query [as 别名]
def by_email_address(cls, email):
"""Return the user object whose email address is ``email``."""
return DBSession.query(cls).filter_by(email_address=email).first()
示例9: listAll
# 需要导入模块: from comcenter.model import DBSession [as 别名]
# 或者: from comcenter.model.DBSession import query [as 别名]
def listAll(cls):
return DBSession.query(cls).order_by(cls.project_status_id).all();
示例10: listAll
# 需要导入模块: from comcenter.model import DBSession [as 别名]
# 或者: from comcenter.model.DBSession import query [as 别名]
def listAll(cls):
return DBSession.query(cls).order_by(cls.years_id).all();
示例11: listAll
# 需要导入模块: from comcenter.model import DBSession [as 别名]
# 或者: from comcenter.model.DBSession import query [as 别名]
def listAll(cls):
return DBSession.query(cls).filter( cls.revenue_list_id != '0' ).order_by(cls.revenue_list_id).all();
示例12: by_user_name
# 需要导入模块: from comcenter.model import DBSession [as 别名]
# 或者: from comcenter.model.DBSession import query [as 别名]
def by_user_name(cls, username):
"""Return the user object whose user name is ``username``."""
return DBSession.query(cls).filter_by(user_name=username).first()
示例13: listAll
# 需要导入模块: from comcenter.model import DBSession [as 别名]
# 或者: from comcenter.model.DBSession import query [as 别名]
def listAll(cls):
return DBSession.query(cls).order_by(cls.book_type_id).all();
示例14: getById
# 需要导入模块: from comcenter.model import DBSession [as 别名]
# 或者: from comcenter.model.DBSession import query [as 别名]
def getById(cls,id):
return DBSession.query(cls) .get(str(id));
示例15: listByGroup
# 需要导入模块: from comcenter.model import DBSession [as 别名]
# 或者: from comcenter.model.DBSession import query [as 别名]
def listByGroup(cls,group):
return DBSession.query(cls).filter( cls.revenue_list_id==str(group) ).order_by(cls.revenue_list_id ).all();