-
Notifications
You must be signed in to change notification settings - Fork 1
matin0728/personal_site
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
ZNode template: import webapp2 import jinja2 import os from google.appengine.ext import ndb import model import service from shared.znode import * class ZNodeFeedItem(ZNode): # meta should contains following data. # meta = { # 'feed_id', # 'question_id', # 'answer_ids' # 'answer_num' # } # view_data should contains(at least) following field. # view_data = { # 'question' : None # 'answers' : [] # 'relation' : None # 'actors' : [] # 'action_type' : 'vote' # } # template_ = 'feed_item.html' client_type = 'ZH.ui.FeedItem' def fetch_data_internal(self): #get feed data from feed ID #self.feed_data = FeedService().get_by_id(self.get_meta('feed_id')) pass def render_answer(self, answer, relation): meta = { # NOTE: we needn't to set the question_id, case it is set on it's parent or ancestor. # 'question_id':self.get_meta('question_id'), 'answer_id': answer.key.id() } a = ZNodeAnswer(self.current_handler, meta = meta) a.set_view_data_item('answer', answer) a.set_view_data_item('relation', relation) self.add_child(a) return a.render() def fetch_data(self): pass
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published