diff options
author | Madhusudan.C.S | 2010-07-13 17:59:47 +0530 |
---|---|---|
committer | Madhusudan.C.S | 2010-07-13 17:59:47 +0530 |
commit | e9ed5af643f96f92f2a9e97c3b751efff8727b6d (patch) | |
tree | 95df3b99b6bc3afe90dab26158bd056a82eaf20f /project/kiwipycon/registration/pdf.py | |
parent | f245bcffa2d4bd4efc6ab934db85eb76626ec599 (diff) | |
download | scipycon-e9ed5af643f96f92f2a9e97c3b751efff8727b6d.tar.gz scipycon-e9ed5af643f96f92f2a9e97c3b751efff8727b6d.tar.bz2 scipycon-e9ed5af643f96f92f2a9e97c3b751efff8727b6d.zip |
Moved the files to new Django app named scipycon and modified settings.
Diffstat (limited to 'project/kiwipycon/registration/pdf.py')
-rw-r--r-- | project/kiwipycon/registration/pdf.py | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/project/kiwipycon/registration/pdf.py b/project/kiwipycon/registration/pdf.py deleted file mode 100644 index 7fec07a..0000000 --- a/project/kiwipycon/registration/pdf.py +++ /dev/null @@ -1,20 +0,0 @@ -import os - -from django.conf import settings -from django.template.loader import render_to_string - -def save_invoice(user, registration, template_name): - content = render_to_string(template_name, - {'registration' : registration, 'user': user}) - filename = '%s.html' % registration.slug - filepath = os.path.join(settings.USER_MEDIA_PDF, filename) - save_to_file(content, filepath) - -def save_to_pdf(content, filepath): - import pisa - pisa.CreatePDF(str(content), file(filepath, 'wb')) - -def save_to_file(content, filepath): - fout = file(filepath, 'wb') - fout.write(content) - fout.close() |