def thread(self, thread, parent): cparent = parent for blip in thread.blips: f = models.finger_blip(blip, cparent, wavelet=self.dbw) if cparent == None: # root blip doitlater.insert_blip(f) for rt in blip.reply_threads: self.thread(rt, f) cparent = f
def post(self): corekey = self.request.get('key') text = self.request.get('reply') parent_f = models.get_response_by_corekey(corekey).response_to laura = makerobot.make_authorized() dbw = parent_f.wavelet wavelet = laura.fetch_wavelet(dbw.wave_id, wavelet_id=dbw.wavelet_id) reply = wavelet.blips[parent_f.blip].continue_thread() reply.append_markup(text) laura.submit(wavelet) models.insert(models.finger_blip(reply, parent_f, dbw), False)
def post(self): key = self.request.get('wavelet') self.blip_id = self.request.get('blip_id') self.dbw, fullwavelet = models.load_wavelet_key(key) parent_id = self.thread(fullwavelet.root_thread, None) if not parent_id: logging.info("Hopeless case, parent no longer exists") if parent_id == "root": parent_id = None parent = models.Fingerprint.all().filter('wavelet =', self.dbw).filter('blip =',parent_id).fetch(1)[0] blip = fullwavelet.blips[self.blip_id] f = models.finger_blip(blip, parent, wavelet=self.dbw) models.insert(f, True)