def get(self): template_values = { "title": "CD List", "cds": CD.query(), "content": "list_cds" } render(self, template_values)
def get(self): template_values = { "title": "Add CD", "groups": Group.query(), "content": "add_cd" } render(self, template_values)
def get(self): template_values = { "title": "Group List", "groups": Group.query(), "content": "list_groups" } render(self, template_values)
def get(self): template_values = { "title": "View Group", "group": Group.get_by_id(int(self.request.get("key"))), "content": "view_group" } render(self, template_values)
def get(self): group_key = ndb.Key(urlsafe=self.request.get("key")) template_values = { "title": "Edit Group", "group": Group.get_by_id(group_key.id()), "content": "edit_group" } render(self, template_values)
def get(self): cd_key = ndb.Key(urlsafe=self.request.get("key")) template_values = { "title": "Edit CD", "cd": CD.get_by_id(cd_key.id()), "groups": Group.query(), "content": "edit_cd" } render(self, template_values)
def get(self): try: msg = self.request.GET['msg'] except: msg = None if msg is None: msg = "Error getting the error, which tried to get the error [A cool example about recursivity]" template_values = { "title": "Error", "error_msg": msg, "content": "error" } render(self, template_values)
def get(self): cd_key = ndb.Key(urlsafe=self.request.get("key")) rating_list = [] comments = Comment.query(Comment.cd == cd_key) for comment in comments: rating_list.append(comment.stars) average_rating = sum(rating_list) / max(len(rating_list), 1) template_values = { "title": "View CD", "cd": CD.get_by_id(cd_key.id()), "comments": comments, "content": "view_cd", "rating": average_rating } render(self, template_values)
def get(self): template_values = {"title": "Add Group", "content": "add_group"} render(self, template_values)
def get(self): template_values = {"title": "Home", "content": "home"} render(self, template_values)