mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-21 15:32:14 +00:00
Merge branch 'django-update' of bitbucket.org:nottinghamtec/pyrigs into django-update
This commit is contained in:
@@ -90,20 +90,24 @@ 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, {
|
|
||||||
'object': object,
|
|
||||||
'fonts': {
|
|
||||||
'opensans': {
|
|
||||||
'regular': 'RIGS/static/fonts/OPENSANS-REGULAR.TTF',
|
|
||||||
'bold': 'RIGS/static/fonts/OPENSANS-BOLD.TTF',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
merger = PdfFileMerger()
|
merger = PdfFileMerger()
|
||||||
|
|
||||||
for copy in copies:
|
for copy in copies:
|
||||||
context['copy'] = copy
|
|
||||||
|
context = RequestContext(request, { # this should be outside the loop, but bug in 1.8.2 prevents this
|
||||||
|
'object': object,
|
||||||
|
'fonts': {
|
||||||
|
'opensans': {
|
||||||
|
'regular': 'RIGS/static/fonts/OPENSANS-REGULAR.TTF',
|
||||||
|
'bold': 'RIGS/static/fonts/OPENSANS-BOLD.TTF',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'copy':copy
|
||||||
|
})
|
||||||
|
|
||||||
|
# context['copy'] = copy # this is the way to do it once we upgrade to Django 1.8.3
|
||||||
|
|
||||||
rml = template.render(context)
|
rml = template.render(context)
|
||||||
buffer = StringIO.StringIO()
|
buffer = StringIO.StringIO()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user