Esempio n. 1
0
 def addMoneyTransfer(self, fromaccount, toaccount, happentime, money, currency, description, user):
     moneytransfer = MoneyTransfer(fromaccount = fromaccount,
                                   toaccount = toaccount,
                                   happentime = happentime,
                                   money = money,
                                   currency = currency,
                                   description = description,
                                   user = user)
     
     moneytransfer.put()
     AccountService().updateAccountMoney(fromaccount, money, -1)
     AccountService().updateAccountMoney(toaccount, money, 1)
Esempio n. 2
0
    def addMoneyTransfer(self, fromaccount, toaccount, happentime, money,
                         currency, description, user):
        moneytransfer = MoneyTransfer(fromaccount=fromaccount,
                                      toaccount=toaccount,
                                      happentime=happentime,
                                      money=money,
                                      currency=currency,
                                      description=description,
                                      user=user)

        moneytransfer.put()
        AccountService().updateAccountMoney(fromaccount, money, -1)
        AccountService().updateAccountMoney(toaccount, money, 1)
Esempio n. 3
0
 def getMoneyTransfer(self, id, user):
     moneytransfer = None
     try:
         moneytransfer = MoneyTransfer.get_by_id(int(id))
         if moneytransfer.user.id <> user.id:
             moneytransfer = None
     except:
         moneytransfer = None
     return moneytransfer
Esempio n. 4
0
 def getMoneyTransfer(self, id, user):
     moneytransfer = None
     try:
         moneytransfer = MoneyTransfer.get_by_id(int(id))
         if moneytransfer.user.id <> user.id:
             moneytransfer = None
     except:
         moneytransfer = None
     return moneytransfer
Esempio n. 5
0
 def getMoneyTransferCount(self, filter_dict, user):
     moneytransfer_list = MoneyTransfer.all()        
     
     if filter_dict:
         for filter_key in filter_dict.keys():
             moneytransfer_list = moneytransfer_list.filter(filter_key, filter_dict[filter_key])
     
     if user:
         moneytransfer_list = moneytransfer_list.filter('user', user)
        
     return moneytransfer_list.count()
Esempio n. 6
0
    def getMoneyTransferCount(self, filter_dict, user):
        moneytransfer_list = MoneyTransfer.all()

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

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

        return moneytransfer_list.count()
Esempio n. 7
0
 def getMoneyTransferList(self, filter_dict, orderby, pagesize, pagecount, user):
     moneytransfer_list = MoneyTransfer.all()
     
     if filter_dict:
         for filter_key in filter_dict.keys():
             moneytransfer_list = moneytransfer_list.filter(filter_key, filter_dict[filter_key])
     
     if user:
         moneytransfer_list = moneytransfer_list.filter('user', user)
     
     total_records = moneytransfer_list.count()
     
     if orderby:
         moneytransfer_list = moneytransfer_list.order(orderby)
     
     if pagesize > 0:
         moneytransfer_list = moneytransfer_list.fetch(pagesize, pagesize * (pagecount-1))
        
     return moneytransfer_list, total_records
Esempio n. 8
0
    def getMoneyTransferList(self, filter_dict, orderby, pagesize, pagecount,
                             user):
        moneytransfer_list = MoneyTransfer.all()

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

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

        total_records = moneytransfer_list.count()

        if orderby:
            moneytransfer_list = moneytransfer_list.order(orderby)

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

        return moneytransfer_list, total_records