Exemple #1
0
 def get_cmt_from_cid(self, str_cid, uid):
     key_name = uid + str_cid
     cmt = UserCmt.get_by_key_name(key_name)
     if not cmt:
         ad = Ad.get_by_id(int(str_cid))
         if not ad:
             logging.warn('%s for unknown Ad cid=%s from_uid=%s' % (self.get_action_name(), str_cid, uid))
             return False
         # create a new user comment entity for this Ad
         return UserCmt(key_name=key_name, feeds=ad.feeds)
     return cmt
Exemple #2
0
 def get_cmt_from_cid(self, str_cid, uid):
     key_name = uid + str_cid
     cmt = UserCmt.get_by_key_name(key_name)
     if not cmt:
         ad = Ad.get_by_id(int(str_cid))
         if not ad:
             logging.warn("%s for unknown Ad cid=%s from_uid=%s" % (self.get_action_name(), str_cid, uid))
             return False
         # create a new user comment entity for this Ad
         return UserCmt(key_name=key_name, feeds=ad.feeds)
     return cmt