Esempio n. 1
0
 def GetOnlineAgents(self):
     FETCH_NUMBER = 30
     tAgentQuery = Agent.all()
     tAgentQuery.filter("agentOnline", True)
     tAgentQuery.order("-agentCurrentOrderTotal")
     tAgents = tAgentQuery.fetch(FETCH_NUMBER)
     return tAgents
Esempio n. 2
0
    def GetContext(self):

        tAgent = Agent()
        tAgentList = []
        tAgentOrders = []
        tAgentDonations = []
        tAgentRequest = self.request.get('agent')
        context = {}

        tAgentList = Agent.all()
        context['agents'] = tAgentList
        if (tAgentRequest != ""):
            tAgent = Agent.get(tAgentRequest)

            tAgentOrdersQuery = Order.all()
            tAgentOrdersQuery.filter('orderAgent', str(tAgentRequest))
            tAgentOrdersQuery.order('-orderCompleted')
            tAgentOrders = tAgentOrdersQuery.fetch(100)

            tAgentDonorsQuery = DonorRecord.all()
            tAgentDonorsQuery.filter('donorAgent', tAgent.agentId)
            tAgentDonorsQuery.order('-donorDate')
            tAgentDonations = tAgentDonorsQuery.fetch(100)

            #logging.debug("Agent Order Count: " + str(len(tAgentOrders)))
            #logging.debug("Agent Donation Count: " + str(len(tAgentDonations)))

            context['agent'] = tAgent
            context['orders'] = tAgentOrders
            context['donations'] = tAgentDonations
            context['extended'] = 'True'

        return context
 def GetOnlineAgents(self):
     FETCH_NUMBER = 30
     tAgentQuery = Agent.all()
     tAgentQuery.filter("agentOnline", True)
     tAgentQuery.order("-agentCurrentOrderTotal")
     tAgents = tAgentQuery.fetch(FETCH_NUMBER)
     return tAgents
 def GetContext(self):
         
     tAgent = Agent()
     tAgentList = []
     tAgentOrders = []
     tAgentDonations = []
     tAgentRequest = self.request.get('agent')
     context = {}
     
     tAgentList = Agent.all()
     context['agents'] = tAgentList
     if (tAgentRequest != ""):
         tAgent = Agent.get(tAgentRequest)
         
         tAgentOrdersQuery = Order.all()
         tAgentOrdersQuery.filter('orderAgent', str(tAgentRequest))
         tAgentOrdersQuery.order('-orderCompleted')
         tAgentOrders = tAgentOrdersQuery.fetch(100)
         
         tAgentDonorsQuery = DonorRecord.all()
         tAgentDonorsQuery.filter('donorAgent', tAgent.agentId)
         tAgentDonorsQuery.order('-donorDate')
         tAgentDonations = tAgentDonorsQuery.fetch(100)
         
         #logging.debug("Agent Order Count: " + str(len(tAgentOrders)))
         #logging.debug("Agent Donation Count: " + str(len(tAgentDonations)))
         
         context['agent'] = tAgent
         context['orders'] = tAgentOrders
         context['donations'] = tAgentDonations
         context['extended'] = 'True'
         
     return context
Esempio n. 5
0
 def GetAvailableBackupAgents(self):
     FETCH_NUMBER = 30
     tAgentQuery = Agent.all()
     tAgentQuery.filter("agentOnline", True)
     tAgentQuery.filter("agentCurrentOrderTotal <", 30000000)
     tAgentQuery.filter("agentIsFullAgent", False)
     tAgentQuery.order("-agentCurrentOrderTotal")
     tAgents = tAgentQuery.fetch(FETCH_NUMBER)
     return tAgents
 def GetAvailableBackupAgents(self):
     FETCH_NUMBER = 30
     tAgentQuery = Agent.all()
     tAgentQuery.filter("agentOnline", True)
     tAgentQuery.filter("agentCurrentOrderTotal <", 1)
     tAgentQuery.filter("agentIsFullAgent", False)
     tAgentQuery.order("-agentCurrentOrderTotal")
     tAgents = tAgentQuery.fetch(FETCH_NUMBER)
     return tAgents