Exemplo n.º 1
0
 def b(self, uuid):
     '''
     Single book page (permalink)
     '''
     book = libraries.get_book(cherrypy.db, uuid=uuid)
     if book:
         tmpl = ENVIRONMENT.get_template('book.html')
         print("BOOK_KEYS: {}".format(book.keys()))
         return tmpl.render(
             book=book,
             this_url='https://library.{}/b/{}'.format(
                 settings.ENV['domain_url'], uuid),
             app_name=settings.APP_NAME,
             )
     else:
         tmpl = ENVIRONMENT.get_template('404.html')
         return tmpl.render(msg='no such book')
Exemplo n.º 2
0
 def b(self, uuid):
     '''
     Single book page (permalink)
     '''
     book = libraries.get_book(cherrypy.db, uuid=uuid)
     if book:
         tmpl = ENVIRONMENT.get_template('book.html')
         print("BOOK_KEYS: {}".format(book.keys()))
         return tmpl.render(
             book=book,
             this_url='https://library.{}/b/{}'.format(
                 settings.ENV['domain_url'], uuid),
             app_name=settings.APP_NAME,
         )
     else:
         tmpl = ENVIRONMENT.get_template('404.html')
         return tmpl.render(msg='no such book')
Exemplo n.º 3
0
 def book(self, uuid):
     '''
     Single book page
     '''
     book = libraries.get_book(cherrypy.db, uuid=uuid)
     return utils.ser2json(book)
Exemplo n.º 4
0
 def book(self, uuid):
     '''
     Single book page
     '''
     book = libraries.get_book(cherrypy.thread_data.db, uuid=uuid)
     return book
Exemplo n.º 5
0
 def book(self, uuid):
     '''
     Single book page
     '''
     book = libraries.get_book(cherrypy.db, uuid=uuid)
     return utils.ser2json(book)
Exemplo n.º 6
0
 def book(self, uuid):
     '''
     Single book page
     '''
     book = libraries.get_book(cherrypy.thread_data.db, uuid=uuid)
     return book