Skip to content

Instantly share code, notes, and snippets.

View benzkji's full-sized avatar
🐙
eight times a thing

Ben Stähli benzkji

🐙
eight times a thing
  • bnzk GmbH
  • Biel/Bienne Switzerland
View GitHub Profile
@zyegfryed
zyegfryed / pdf.py
Created April 13, 2011 21:00
Outputting PDFs with Django and FDFgen
# -*- coding: utf-8 -*-
import codecs
import subprocess
from fdfgen import forge_fdf
from django.template import Template, loader
from django.template.loader import find_template, LoaderOrigin
class PdfTemplateError(Exception):
@ojii
ojii / embedable_plugin.py
Created February 25, 2011 10:06
The bit inside the 'cmsplugin' tag is actually a link plugin!
class LinkPlugin(CMSPluginBase):
def get_embed_content(self, instance, parent_instance):
ctx = Context()
return render_to_string(self.render_template, self.render(ctx, instance, None))