def get(self): def sorter(author): return (author.contribution_count, author.idea_count, author.post_count) authors = Author.all().fetch(1000) authors.sort(key=sorter, reverse=True) return self.render('authors.html', {'authors': authors})
def get_responce(self, *args, **kwargs): x = dict( ((author.key().name(), {"url":author.key().name(), "image_url":author.image_url, "title":author.title, "subtitle":author.subtitle, "name":author.name}) for author in Author.all()) ) return x
def get_responce(self, *args, **kwargs): x = dict(((author.key().name(), { "url": author.key().name(), "image_url": author.image_url, "title": author.title, "subtitle": author.subtitle, "name": author.name }) for author in Author.all())) return x
def get(self): disease_counts = Publication.get_disease_counts() authors = Author.all() pubs = Publication.all() template_values = { "authors": authors, "disease_counts": disease_counts, "pubs": pubs } template = jinja_environment.get_template('admin.html') self.response.out.write(template.render(template_values))
async def get_authors(): # print(Book_Pydantic.schema_json(indent=4)) # print(Author_Pydantic.schema_json(indent=4)) return await Author_Pydantic.from_queryset(Author.all())