commit 416a8811b35396176b7c57b5e96faa8abfe0adec Author: Binh Nguyen Date: Tue Oct 8 13:09:36 2013 -0500 Initial commit 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) + +