From 416a8811b35396176b7c57b5e96faa8abfe0adec Mon Sep 17 00:00:00 2001 From: Binh Nguyen Date: Tue, 8 Oct 2013 13:09:36 -0500 Subject: [PATCH] Initial commit --- .gitignore | 1 + __init__.py | 1 + models.py | 3 +++ sites.py | 25 +++++++++++++++++++++++++ tests.py | 16 ++++++++++++++++ urls.py | 7 +++++++ views/__init__.py | 0 views/editor.py | 11 +++++++++++ 8 files changed, 64 insertions(+) create mode 100644 .gitignore create mode 100644 __init__.py create mode 100644 models.py create mode 100644 sites.py create mode 100644 tests.py create mode 100644 urls.py create mode 100644 views/__init__.py create mode 100644 views/editor.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0d20b64 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pyc diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..48d67f6 --- /dev/null +++ b/__init__.py @@ -0,0 +1 @@ +from sites import site diff --git a/models.py b/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/sites.py b/sites.py new file mode 100644 index 0000000..833848b --- /dev/null +++ b/sites.py @@ -0,0 +1,25 @@ +from functools import update_wrapper +from django import http + + +class PDFFormFillerSite(object): + def __init__(self, name='pdfformfiller', app_name='pdfformfiller'): + self.name = name + self.app_name = app_name + + def get_urls(self): + from django.conf.urls import patterns, url, include + view = self.view + + urlpatterns = patterns('', + url(r'^(?P\w+)/edit/$', view.edit, name='edit'), + ) + + return urlpatterns + + @property + def urls(self): + return self.get_urls(), self.app_name, self.name + + +site = PDFFormFillerSite() diff --git a/tests.py b/tests.py new file mode 100644 index 0000000..501deb7 --- /dev/null +++ b/tests.py @@ -0,0 +1,16 @@ +""" +This file demonstrates writing tests using the unittest module. These will pass +when you run "manage.py test". + +Replace this with more appropriate tests for your application. +""" + +from django.test import TestCase + + +class SimpleTest(TestCase): + def test_basic_addition(self): + """ + Tests that 1 + 1 always equals 2. + """ + self.assertEqual(1 + 1, 2) diff --git a/urls.py b/urls.py new file mode 100644 index 0000000..cf672c1 --- /dev/null +++ b/urls.py @@ -0,0 +1,7 @@ +from django.conf.urls import patterns, url +from pdfformfiller.views import editor + +urlpatterns = patterns('pdfformfiller.views', + url(r'^(?P.*)/edit/$', editor.PDFFormFillerEditorView.as_view(), name='pdfformfiller-edit'), +) + diff --git a/views/__init__.py b/views/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/views/editor.py b/views/editor.py new file mode 100644 index 0000000..a526787 --- /dev/null +++ b/views/editor.py @@ -0,0 +1,11 @@ +from django.views.generic import View +from django.http import HttpResponse + + +class PDFFormFillerEditorView(View): + def get(self, request, pdf=""): + + + return HttpResponse("response from editor view %s" % pdf) + +