예제 #1
0
    def get(self):
        messagelist = Message.query(Message.receiverkey == self.user.key)
        messagelist = messagelist.order(-Message.sendtimestamp)

        context = {
            'messages': messagelist,
            }

        self.response.out.write(self.loadtemplate(context))
예제 #2
0
    def get(self, messagekey):
        message = Message.getbykey(messagekey)
        if not message.read:
            message.read = True
            message.put()

        if not hasattr(self, '_thread'):
            self._thread = []
            parent = message.parent
            while parent is not None and parent not in self._thread:
                self._thread.append(parent)
                parent = parent.parent
            self._thread.reverse()

        context = {
            'message': message,
            'thread': self._thread,
            }

        self.response.out.write(self.loadtemplate(context))