Initial commit
This commit is contained in:
commit
416a8811b3
8 changed files with 64 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
*.pyc
|
1
__init__.py
Normal file
1
__init__.py
Normal file
|
@ -0,0 +1 @@
|
||||||
|
from sites import site
|
3
models.py
Normal file
3
models.py
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
from django.db import models
|
||||||
|
|
||||||
|
# Create your models here.
|
25
sites.py
Normal file
25
sites.py
Normal file
|
@ -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<pdf>\w+)/edit/$', view.edit, name='edit'),
|
||||||
|
)
|
||||||
|
|
||||||
|
return urlpatterns
|
||||||
|
|
||||||
|
@property
|
||||||
|
def urls(self):
|
||||||
|
return self.get_urls(), self.app_name, self.name
|
||||||
|
|
||||||
|
|
||||||
|
site = PDFFormFillerSite()
|
16
tests.py
Normal file
16
tests.py
Normal file
|
@ -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)
|
7
urls.py
Normal file
7
urls.py
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
from django.conf.urls import patterns, url
|
||||||
|
from pdfformfiller.views import editor
|
||||||
|
|
||||||
|
urlpatterns = patterns('pdfformfiller.views',
|
||||||
|
url(r'^(?P<pdf>.*)/edit/$', editor.PDFFormFillerEditorView.as_view(), name='pdfformfiller-edit'),
|
||||||
|
)
|
||||||
|
|
0
views/__init__.py
Normal file
0
views/__init__.py
Normal file
11
views/editor.py
Normal file
11
views/editor.py
Normal file
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue