Exemple #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')
Exemple #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')
Exemple #3
0
 def book(self, uuid):
     '''
     Single book page
     '''
     book = libraries.get_book(cherrypy.db, uuid=uuid)
     return utils.ser2json(book)
Exemple #4
0
 def book(self, uuid):
     '''
     Single book page
     '''
     book = libraries.get_book(cherrypy.thread_data.db, uuid=uuid)
     return book
Exemple #5
0
 def book(self, uuid):
     '''
     Single book page
     '''
     book = libraries.get_book(cherrypy.db, uuid=uuid)
     return utils.ser2json(book)
 def book(self, uuid):
     '''
     Single book page
     '''
     book = libraries.get_book(cherrypy.thread_data.db, uuid=uuid)
     return book