def post(self):
   sub_ids = self.request.get_all('id')
   doc = matcher.get_document(self.request)
   user_id = self.request.get('topic')
   assert isinstance(doc, MatcherDocument)
   for sub_id in sub_ids:
     subscription_info = db.GqlQuery('SELECT * FROM SubscriptionInfo WHERE' +
         ' subscription_id = :1 AND user_id = :2', sub_id, user_id).get()
     if not subscription_info: continue
     db.run_in_transaction(self.__Increment, subscription_info.key())
示例#2
0
 def post(self, **kwargs):
     """Parses all the fields out of a match and pass along."""
     form = self.request.form
     result = self.match(sub_ids=form.getlist('id'),
                         key=form.get('key'),
                         topic=form['topic'],
                         results_count=int(form['results_count']),
                         results_offset=int(form['results_offset']),
                         doc=matcher.get_document(form),
                         **kwargs)
     return result
示例#3
0
文件: matcher.py 项目: acettt/yandex
 def post(self, **kwargs):
     """Parses all the fields out of a match and pass along."""
     form = self.request.form
     result = self.match(
         sub_ids=form.getlist('id'),
         key=form.get('key'),
         topic=form['topic'],
         results_count=int(form['results_count']),
         results_offset=int(form['results_offset']),
         doc=matcher.get_document(form),
         **kwargs
     )
     return result