Exemple #1
0
 def addMoneyBL(self, account, isio, happentime, money, currency, description, user):
     moneybl = MoneyBL(account = account,
                                   isio = isio,
                                   happentime = happentime,
                                   money = money,
                                   currency = currency,
                                   description = description,
                                   user = user)
     
     moneybl.put()
     AccountService().updateAccountMoney(account, money, isio)
Exemple #2
0
    def addMoneyBL(self, account, isio, happentime, money, currency,
                   description, user):
        moneybl = MoneyBL(account=account,
                          isio=isio,
                          happentime=happentime,
                          money=money,
                          currency=currency,
                          description=description,
                          user=user)

        moneybl.put()
        AccountService().updateAccountMoney(account, money, isio)
Exemple #3
0
 def getMoneyBL(self, id, user):
     moneybl = None
     try:
         moneybl = MoneyBL.get_by_id(int(id))
         if moneybl.user.id <> user.id:
             moneybl = None
     except:
         moneybl = None
     return moneybl
Exemple #4
0
 def getMoneyBL(self, id, user):
     moneybl = None
     try:
         moneybl = MoneyBL.get_by_id(int(id))
         if moneybl.user.id <> user.id:
             moneybl = None
     except:
         moneybl = None
     return moneybl
Exemple #5
0
 def getMoneyBLCount(self, filter_dict, user):
     moneybl_list = MoneyBL.all()        
     
     if filter_dict:
         for filter_key in filter_dict.keys():
             moneybl_list = moneybl_list.filter(filter_key, filter_dict[filter_key])
     
     if user:
         moneybl_list = moneybl_list.filter('user', user)
        
     return moneybl_list.count()
Exemple #6
0
    def getMoneyBLCount(self, filter_dict, user):
        moneybl_list = MoneyBL.all()

        if filter_dict:
            for filter_key in filter_dict.keys():
                moneybl_list = moneybl_list.filter(filter_key,
                                                   filter_dict[filter_key])

        if user:
            moneybl_list = moneybl_list.filter('user', user)

        return moneybl_list.count()
Exemple #7
0
 def getMoneyBLList(self, filter_dict, orderby, pagesize, pagecount, user):
     moneybl_list = MoneyBL.all()
     
     if filter_dict:
         for filter_key in filter_dict.keys():
             moneybl_list = moneybl_list.filter(filter_key, filter_dict[filter_key])
     
     if user:
         moneybl_list = moneybl_list.filter('user', user)
     
     total_records = moneybl_list.count()
     
     if orderby:
         moneybl_list = moneybl_list.order(orderby)
     
     if pagesize > 0:
         moneybl_list = moneybl_list.fetch(pagesize, pagesize * (pagecount-1))
        
     return moneybl_list, total_records
Exemple #8
0
    def getMoneyBLList(self, filter_dict, orderby, pagesize, pagecount, user):
        moneybl_list = MoneyBL.all()

        if filter_dict:
            for filter_key in filter_dict.keys():
                moneybl_list = moneybl_list.filter(filter_key,
                                                   filter_dict[filter_key])

        if user:
            moneybl_list = moneybl_list.filter('user', user)

        total_records = moneybl_list.count()

        if orderby:
            moneybl_list = moneybl_list.order(orderby)

        if pagesize > 0:
            moneybl_list = moneybl_list.fetch(pagesize,
                                              pagesize * (pagecount - 1))

        return moneybl_list, total_records