This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A decorator for management commands (or any class method) to ensure that there is | |
only ever one process running the method at any one time. | |
Requires lockfile - (pip install lockfile) | |
Author: Ross Lawley | |
""" | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This generic view displays a list of objects and a simple ModelForm to add a new | |
object to the list. | |
Just subclass this view and override the attributes and methods that you need. You | |
will probably need to override at least 'model', 'form_class' and 'success_url'. | |
See the documentation of the used mixins and ProcessFormView in | |
https://docs.djangoproject.com/en/1.4/ref/class-based-views/ | |
""" | |
from django.views.generic.list import MultipleObjectMixin, MultipleObjectTemplateResponseMixin | |
from django.views.generic.edit import ModelFormMixin, ProcessFormView |