Пример #1
0
def list_offers_loc(lat1, long1, update = False):
    key = 'list_offers_loc' + str(lat1) + str(long1)
    offers = memcache.get(key)
    if offers is None or update:
        logging.error('DB QUERY')
        #TODO impl logica para sacar las ofertas por localizacion
        offers = Profile.by_loc(lat1, long1)
        memcache.set(key, offers)
        
    return offers
Пример #2
0
    def get(self):

        lat1 = self.request.get("lat1")
        lon1 = self.request.get("lon1")


        #self.offers = list_offers_loc(lat1, lon1) #(53.4211041, -7.942588199999999)
        self.offers = offers = Profile.by_loc(lat1, lon1)
        logging.error('offers.results: %s' % type(self.offers.results))
        logging.error('offers.results[0]: %s' % type(self.offers.results[0]))
        logging.error('offers.results[0].fields: %s' % type(self.offers.results[0].fields))
        logging.error('al loro: %s' % self.offers)

        self.render('ioffer_offers_list.html', offers = self.offers)