示例#1
0
文件: search.py 项目: Hajfajf/YDD
 def get(self):
   restaurants = YelpRestaurant.all().filter("checked =", False)
   related_partner = self.request.get('partner')
   #related_id = self.request.get('partner_id')
   coupon = []
   if related_partner == 'restaurantcom':
     coupon = RestaurantcomCoupon.get_by_key_name(self.request.get('partner_id'))
   template_values = {
       'restaurants': restaurants,
       'related_partner': related_partner,
       'coupon': coupon
     }
   self.response.out.write(template.render('templates/yelpresults.html', template_values))
示例#2
0
    def post(self):
        coupon = RestaurantcomCoupon.get_by_key_name(self.request.get('coupon_id'))
        coupon.yelpid = self.request.get('yelp_id')
        coupon.yelpid_matched = True
        coupon.put()

        sameid_coupons = RestaurantcomCoupon.all().filter('restaurant_name =', coupon.restaurant_name)
        if sameid_coupons:
            for sameid_coupon in sameid_coupons:
                if sameid_coupon.address_street == coupon.address_street:
                    sameid_coupon.yelpid = self.request.get('yelp_id')
                    sameid_coupon.yelpid_matched = True
                    sameid_coupon.put()
                else:
                    pass

        self.redirect('/admin/overview')
示例#3
0
    def post(self):
        coupon = RestaurantcomCoupon.get_by_key_name(
            self.request.get('coupon_id'))
        coupon.yelpid = self.request.get('yelp_id')
        coupon.yelpid_matched = True
        coupon.put()

        sameid_coupons = RestaurantcomCoupon.all().filter(
            'restaurant_name =', coupon.restaurant_name)
        if sameid_coupons:
            for sameid_coupon in sameid_coupons:
                if sameid_coupon.address_street == coupon.address_street:
                    sameid_coupon.yelpid = self.request.get('yelp_id')
                    sameid_coupon.yelpid_matched = True
                    sameid_coupon.put()
                else:
                    pass

        self.redirect('/admin/overview')