periode_pdf_2
This commit is contained in:
parent
776ff9f4fe
commit
83cca59c7e
2 changed files with 12 additions and 8 deletions
16
cms/views.py
16
cms/views.py
|
|
@ -3,10 +3,12 @@ Created on 4 déc. 2012
|
|||
|
||||
@author: alzo
|
||||
"""
|
||||
import os
|
||||
|
||||
from django.views.generic import ListView, TemplateView, DetailView
|
||||
from django.db.models import F, Sum
|
||||
from django.http import HttpResponse
|
||||
|
||||
from django.conf import settings
|
||||
from reportlab.platypus import Paragraph, Spacer, Table, TableStyle, Preformatted
|
||||
from reportlab.lib.units import cm
|
||||
from reportlab.lib import colors
|
||||
|
|
@ -269,10 +271,12 @@ class ModulePDF(DetailView):
|
|||
[preformatted_left('Responsable'), preformatted_right(m.processus.domaine.responsable.descr_pdf())],
|
||||
]
|
||||
t = Table(data, colWidths=[2.5*cm, 10*cm])
|
||||
t.setStyle(TableStyle([
|
||||
('ALIGN', (0, 0), (-1, -1), 'LEFT'),
|
||||
('VALIGN', (0, 0), (-1, -1), 'TOP'),
|
||||
('LEFTPADDING', (0, 0), (-1, -1), 0), ])
|
||||
t.setStyle(
|
||||
TableStyle([
|
||||
('ALIGN', (0, 0), (-1, -1), 'LEFT'),
|
||||
('VALIGN', (0, 0), (-1, -1), 'TOP'),
|
||||
('LEFTPADDING', (0, 0), (-1, -1), 0), ]
|
||||
)
|
||||
)
|
||||
t.hAlign = 0
|
||||
response.story.append(Spacer(0, 1*cm))
|
||||
|
|
@ -321,7 +325,7 @@ class PeriodePDFView(TemplateView):
|
|||
|
||||
def render_to_response(self, context, **response_kwargs):
|
||||
context = get_context(context)
|
||||
filename = 'media/periode.pdf'
|
||||
filename = os.path.join(settings.MEDIA_ROOT, 'periode.pdf')
|
||||
pdf = PeriodPDF(filename)
|
||||
for semestre_id in range(1, 7):
|
||||
modules = context['sem{0}'.format(str(semestre_id))]
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ endobj
|
|||
<< /Outlines 10 0 R /PageMode /UseNone /Pages 8 0 R /Type /Catalog >>
|
||||
endobj
|
||||
7 0 obj
|
||||
<< /Author (anonymous) /CreationDate (D:20170814072142-01'00') /Creator (ReportLab PDF Library - www.reportlab.com) /Keywords () /ModDate (D:20170814072142-01'00') /Producer (ReportLab PDF Library - www.reportlab.com)
|
||||
<< /Author (anonymous) /CreationDate (D:20170814074017-01'00') /Creator (ReportLab PDF Library - www.reportlab.com) /Keywords () /ModDate (D:20170814074017-01'00') /Producer (ReportLab PDF Library - www.reportlab.com)
|
||||
/Subject (unspecified) /Title (untitled) /Trapped /False >>
|
||||
endobj
|
||||
8 0 obj
|
||||
|
|
@ -243,7 +243,7 @@ xref
|
|||
trailer
|
||||
<< /ID
|
||||
% ReportLab generated PDF document -- digest (http://www.reportlab.com)
|
||||
[(\240o\267o\321\233L:\251\3545\212P1\275h) (\240o\267o\321\233L:\251\3545\212P1\275h)]
|
||||
[(\353\211\003\306uO\376\265\357\030\317\244\200\211\306w) (\353\211\003\306uO\376\265\357\030\317\244\200\211\306w)]
|
||||
/Info 7 0 R /Root 6 0 R /Size 11 >>
|
||||
startxref
|
||||
98675
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue