web/views/basetemplates.py
changeset 3085 b415bca9a9ed
parent 3072 6fb42c53f6df
parent 3080 32c2b6a34ab2
child 3185 bd0126d17e83
--- a/web/views/basetemplates.py	Wed Sep 02 10:22:47 2009 +0200
+++ b/web/views/basetemplates.py	Wed Sep 02 10:24:15 2009 +0200
@@ -270,7 +270,7 @@
     from subprocess import Popen as sub
     from StringIO import StringIO
     from tempfile import NamedTemporaryFile
-    from cubicweb.web.xhtml2fo import ReportTransformer
+    from cubicweb.ext.xhtml2fo import ReportTransformer
 
     class PdfMainTemplate(TheMainTemplate):
         id = 'pdf-main-template'
@@ -279,7 +279,8 @@
             """build the standard view, then when it's all done, convert xhtml to pdf
             """
             super(PdfMainTemplate, self).call(view)
-            pdf = self.to_pdf(self._stream)
+            section = self.req.form.pop('section', 'contentmain')
+            pdf = self.to_pdf(self._stream, section)
             self.req.set_content_type('application/pdf', filename='report.pdf')
             self.binary = True
             self.w = None
@@ -287,7 +288,7 @@
             # pylint needs help
             self.w(pdf)
 
-        def to_pdf(self, stream, section='contentmain'):
+        def to_pdf(self, stream, section):
             # XXX see ticket/345282
             stream = stream.getvalue().replace(' ', ' ').encode('utf-8')
             xmltree = ElementTree()