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)));
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;
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()
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();
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 expenses_list_id = " + group; if(subgroup): sql = sql + " and expenses_sub_list_id = " + subgroup; log.info(sql); return DBSession.query(cls).filter(sql).all();
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)));
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();
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
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()
def listAll(cls): return DBSession.query(cls).order_by( cls.dental_senior_club_service_id).all()
def listAll(cls): return DBSession.query(cls).order_by( cls.dental_child_dev_center_service_id).all()
def listAll(cls): return DBSession.query(cls).order_by(cls.years_id).all();
def listAll(cls): return DBSession.query(cls).order_by(cls.dental_school_kpi_id).all()
def getById(cls, id): return DBSession.query(cls).get(str(id))
def listAll(cls): return DBSession.query(cls).order_by(cls.school_class_id).all();
def listAll(cls): return DBSession.query(cls).filter( cls.revenue_list_id != '0').order_by(cls.revenue_list_id).all()
def listAll(cls): return DBSession.query(cls).filter(cls.active == 1).order_by( cls.years_id).all()
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()
def getByBookId(cls, id): return DBSession.query(cls).filter(cls.book_id == id).all()
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()
def test_query_obj(self): """Model objects can be queried""" obj = DBSession.query(self.klass).one() for key, value in self.attrs.iteritems(): assert_equals(getattr(obj, key), value)
def listAll(cls): return DBSession.query(cls).all();
def listAll(cls): return DBSession.query(cls).order_by(cls.project_status_id).all();
def listAll(cls): return DBSession.query(cls).order_by(cls.revenue_sub_list_id).all()
def listAll(cls): return DBSession.query(cls).order_by(cls.description).all();
def listAll(cls): return DBSession.query(cls).order_by(cls.fiscal_year).all();
def listAll(cls): return DBSession.query(cls).order_by(cls.expenses_sub_list_id).all();
def test_query_obj(self): """Model objects can be queried""" obj = DBSession.query(self.klass).one() for key, value in self.attrs.items(): eq_(getattr(obj, key), value)
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()
def listAll(cls): return DBSession.query(cls).filter( cls.revenue_list_id != '0' ).order_by(cls.revenue_list_id).all();
def listAll(cls): return DBSession.query(cls).filter( cls.active == 1 ).order_by(cls.years_id).all();
def listAll(cls): return DBSession.query(cls).order_by(cls.years_id).all()
def listkpibygroup(cls, group): return DBSession.query(cls).filter( cls.dental_school_kpi_group_id == str(group)).order_by( cls.dental_school_kpi_id).all()
def listAll(cls): return DBSession.query(cls).order_by(cls.book_type_id).all();
def listAll(cls): return DBSession.query(cls).order_by(cls.senior_club_id).all()
def listAll(cls): return DBSession.query(cls).order_by(cls.school_class_id).all()
def listAll(cls): return DBSession.query(cls).order_by(cls.child_dev_center_id).all()
def listAll(cls): return DBSession.query(cls).order_by(cls.book_type_id).all()
def listPrimarySchool(cls): return DBSession.query(cls).filter(cls.high_school == str(0)).order_by( cls.school_id).all()
def listByDivision(cls,division): return DBSession.query(cls).filter( cls.division_id==str(division) ).order_by(cls.section_id ).all();
def listAll(cls): return DBSession.query(cls).order_by(cls.revenue_sub_list_id).all();
def listAll(cls): return DBSession.query(cls).all()
def listByGroup(cls,group): return DBSession.query(cls).filter( cls.revenue_list_id==str(group) ).order_by(cls.revenue_list_id ).all();
def listkpibygroup(cls,group): return DBSession.query(cls).filter( cls.dental_school_kpi_group_id==str(group) ).order_by(cls.dental_school_kpi_id ).all();
def getByBookId(cls,id): return DBSession.query(cls).filter(cls.book_id == id).all();
def listAll(cls): return DBSession.query(cls).order_by(cls.dental_school_kpi_id).all();
def listAll(cls): return DBSession.query(cls).order_by(cls.project_status_id).all()
def listAll(cls): return DBSession.query(cls).order_by(cls.senior_club_id).all();
def getById(cls,id): return DBSession.query(cls) .get(str(id));
def listAll(cls): return DBSession.query(cls).order_by(cls.dental_senior_club_service_id).all();
def listAll(cls): return DBSession.query(cls).order_by(cls.fiscal_year).all();
def listAll(cls): return DBSession.query(cls).order_by(cls.child_dev_center_id).all();
def listAll(cls): return DBSession.query(cls).filter( cls.expenses_list_id != '0' ).order_by(cls.expenses_list_id).all();
def listAll(cls): return DBSession.query(cls).order_by(cls.dental_child_dev_center_service_id).all();
def listByGroup(cls,group): return DBSession.query(cls).filter( cls.expenses_list_id==str(group) ).order_by(cls.expenses_list_id ).all();
def listPrimarySchool(cls): return DBSession.query(cls).filter( cls.high_school==str(0) ).order_by(cls.school_id).all();
def listAll(cls): return DBSession.query(cls).order_by(cls.description).all()
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()