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