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
0
文件: books.py 项目: tongpa/bantakCom
 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
0
    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
0
 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();
示例#5
0
 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)));
示例#7
0
 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();
示例#8
0
    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
示例#9
0
    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()
示例#10
0
 def listAll(cls):
     return DBSession.query(cls).order_by(
         cls.dental_senior_club_service_id).all()
示例#11
0
 def listAll(cls):
     return DBSession.query(cls).order_by(
         cls.dental_child_dev_center_service_id).all()
示例#12
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.years_id).all();
示例#13
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.dental_school_kpi_id).all()
示例#14
0
 def getById(cls, id):
     return DBSession.query(cls).get(str(id))
示例#15
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.school_class_id).all();
示例#16
0
 def listAll(cls):
     return DBSession.query(cls).filter(
         cls.revenue_list_id != '0').order_by(cls.revenue_list_id).all()
示例#17
0
 def listAll(cls):
     return DBSession.query(cls).filter(cls.active == 1).order_by(
         cls.years_id).all()
示例#18
0
文件: auth.py 项目: tongpa/bantakCom
 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()
示例#19
0
 def getByBookId(cls, id):
     return DBSession.query(cls).filter(cls.book_id == id).all()
示例#20
0
文件: auth.py 项目: tongpa/bantakCom
 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()
示例#21
0
 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)
示例#22
0
 def listAll(cls):
     return DBSession.query(cls).all();
示例#23
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.project_status_id).all();
示例#24
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.revenue_sub_list_id).all()
示例#25
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.description).all();
示例#26
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.fiscal_year).all();
示例#27
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.expenses_sub_list_id).all();
示例#28
0
 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)
示例#29
0
 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()
示例#30
0
 def listAll(cls):
     return DBSession.query(cls).filter(  cls.revenue_list_id != '0' ).order_by(cls.revenue_list_id).all();
示例#31
0
 def listAll(cls):
     return DBSession.query(cls).filter(  cls.active == 1 ).order_by(cls.years_id).all();  
示例#32
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.years_id).all()
示例#33
0
 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()
示例#34
0
文件: books.py 项目: tongpa/bantakCom
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.book_type_id).all(); 
示例#35
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.senior_club_id).all()
示例#36
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.school_class_id).all()
示例#37
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.child_dev_center_id).all()
示例#38
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.book_type_id).all()
示例#39
0
 def listPrimarySchool(cls):
     return DBSession.query(cls).filter(cls.high_school == str(0)).order_by(
         cls.school_id).all()
示例#40
0
 def listByDivision(cls,division):
     return DBSession.query(cls).filter(  cls.division_id==str(division) ).order_by(cls.section_id ).all();
示例#41
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.revenue_sub_list_id).all();
示例#42
0
 def listAll(cls):
     return DBSession.query(cls).all()
示例#43
0
 def listByGroup(cls,group):
     return DBSession.query(cls).filter(  cls.revenue_list_id==str(group) ).order_by(cls.revenue_list_id ).all();
示例#44
0
 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();
示例#45
0
文件: books.py 项目: tongpa/bantakCom
 def getByBookId(cls,id):
     return DBSession.query(cls).filter(cls.book_id == id).all();   
示例#46
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.dental_school_kpi_id).all();
示例#47
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.project_status_id).all()
示例#48
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.senior_club_id).all();
示例#49
0
 def getById(cls,id):
     return DBSession.query(cls) .get(str(id));  
示例#50
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.dental_senior_club_service_id).all();
示例#51
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.fiscal_year).all();
示例#52
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.child_dev_center_id).all();
示例#53
0
 def listAll(cls):
     return DBSession.query(cls).filter(  cls.expenses_list_id != '0' ).order_by(cls.expenses_list_id).all();
示例#54
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.dental_child_dev_center_service_id).all();
示例#55
0
 def listByGroup(cls,group):
     return DBSession.query(cls).filter(  cls.expenses_list_id==str(group) ).order_by(cls.expenses_list_id ).all();
示例#56
0
 def listPrimarySchool(cls):
     return DBSession.query(cls).filter(  cls.high_school==str(0) ).order_by(cls.school_id).all();
示例#57
0
 def listAll(cls):
     return DBSession.query(cls).order_by(cls.description).all()
示例#58
0
 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()