ReptarX / pyfpdf

Automatically exported from code.google.com/p/pyfpdf
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Web2py sample app has what should be view code in the controller, but is easily fixable #79

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The web2py sample reporting app 
(http://pyfpdf.googlecode.com/files/web2py.app.fpdf.w2p) has code that handles 
view generation embedded in the controller (default.py). There is views defined 
(views/default/report.pdf.bak) but it is noted that they produce a corrupted 
pdf (which they do). However relatively changes means this code can be 
essentially moved to a view handler and thus fits web2py's MVC design much 
better.

I am using web2py 2.9.11 with python 2.7.6 on Ubuntu 14.04.

Original issue reported on code.google.com by mark.kir...@gmail.com on 11 Nov 2014 at 4:04

Attachments:

GoogleCodeExporter commented 9 years ago
Note that these patches make the original design work. The newer approach 
(packaged with later web2py releases) works like this: you request a pdf as 
before (report.pdf) and the generic pdf view 1st runs your report.html and then 
converts the entirety of that to a pdf.

Now this is cool *but* there is still a wide use case for the more segregated 
approach used in this sample app (for instance I'm using something like this as 
the html generated by my default view is not convertable - has colspan elements 
- so it is either rewrite a special new html view that *is*, or just write a 
separate pdf view...which I did).

Original comment by mark.kir...@gmail.com on 11 Nov 2014 at 6:14