예제 #1
0
 def get(self, document_id):
     template_vals = {}
     bunnies_result = Bunny.query(Bunny.document_id == str(document_id)).order(Bunny.timestamp).iter()
     bunnies = []
     for bunny in bunnies_result:
         bunnies.append(bunny)
     template_vals['bunnies'] = bunnies
     template_vals['doc_id'] = document_id
     doc = Document.get_by_id(int(document_id))
     template_vals['doc_name'] = doc.title
     template_vals['lecture_id'] = doc.lecture_id
     render(self, template_vals, 'workspace.html')
예제 #2
0
 def get(self, notebook_id):
     template_vals = {'name_of_user': users.get_current_user().nickname()}
     notebook = Notebook.get_by_id(int(notebook_id))
     #   Get all documents for notebook
     titles = list()
     docs = list()
     for doc in notebook.document_ids:
         docs.append(int(doc))
         titles.append(Document.get_by_id(int(doc)).title)
     template_vals['titles'] = titles
     template_vals['nb_id'] = int(notebook_id)
     template_vals['doc_ids'] = docs
     render(self, template_vals, 'notebook-documents.html')