Merge branch 'django-update' of bitbucket.org:nottinghamtec/pyrigs into django-update

This commit is contained in:
Tom Price
2015-05-28 22:59:19 +01:00

View File

@@ -90,7 +90,12 @@ class EventPrint(generic.View):
object = get_object_or_404(models.Event, pk=pk) object = get_object_or_404(models.Event, pk=pk)
template = get_template('RIGS/event_print.xml') template = get_template('RIGS/event_print.xml')
copies = ('TEC', 'Client') copies = ('TEC', 'Client')
context = RequestContext(request, {
merger = PdfFileMerger()
for copy in copies:
context = RequestContext(request, { # this should be outside the loop, but bug in 1.8.2 prevents this
'object': object, 'object': object,
'fonts': { 'fonts': {
'opensans': { 'opensans': {
@@ -98,12 +103,11 @@ class EventPrint(generic.View):
'bold': 'RIGS/static/fonts/OPENSANS-BOLD.TTF', 'bold': 'RIGS/static/fonts/OPENSANS-BOLD.TTF',
} }
}, },
'copy':copy
}) })
merger = PdfFileMerger() # context['copy'] = copy # this is the way to do it once we upgrade to Django 1.8.3
for copy in copies:
context['copy'] = copy
rml = template.render(context) rml = template.render(context)
buffer = StringIO.StringIO() buffer = StringIO.StringIO()