def get(self): # messages update check msg = ReadMessage(self.current_user.id, self.last_modified_time) messages = msg.getMessages() #self.set_header('Last-Modified', pretty_time_str(datetime.datetime.utcnow())) self.render_json({'num': len(messages)})
def get(self): msg = ReadMessage(self.current_user.id, self.last_modified_time) messages = msg.getMessages() message_collection = { 'messages': messages, 'total': len(messages), 'link': self.full_uri(), } self.set_header('Last-Modified', pretty_time_str(datetime.datetime.utcnow())) self.render_json(message_collection)