Exemplo n.º 1
0
 def transform(wldoc, fieldfile):
     # ugly, but we can't use wldoc.book_info here
     from librarian import DCNS
     url_elem = wldoc.edoc.getroot().find('.//' + DCNS('identifier.url'))
     if url_elem is None:
         gallery = ''
     else:
         gallery = gallery_url(slug=url_elem.text.rsplit('/', 1)[1])
     return wldoc.as_html(options={'gallery': "'%s'" % gallery})
Exemplo n.º 2
0
 def transform(wldoc, fieldfile):
     # ugly, but we can't use wldoc.book_info here
     from librarian import DCNS
     url_elem = wldoc.edoc.getroot().find('.//' + DCNS('identifier.url'))
     if url_elem is None:
         gallery = ''
     else:
         gallery = gallery_url(slug=url_elem.text.rsplit('/', 1)[1])
     return wldoc.as_html(options={'gallery': "'%s'" % gallery})
Exemplo n.º 3
0
 def gallery_url(self):
     return gallery_url(self.slug)