Permalink
Browse files

Providing a testing page for the frontend which is not the admin.

  • Loading branch information...
1 parent c425435 commit e4d099d541639e588b356ffccbfe31fb8db2ae4b @gregmuellegger committed Jul 15, 2013
@@ -16,3 +16,7 @@ class ParkingArea(models.Model):
def __unicode__(self):
return self.name
+
+ @models.permalink
+ def get_absolute_url(self):
+ return 'parkingarea', (self.pk,), {}
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html lang="">
+<head>
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+ <title>Parkingarea</title>
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
+ {{ form.media }}
+</head>
+<body>
+ <h1>Parkingarea {{ object.name }}</h1>
+
+ <form action="" method="post">{% csrf_token %}
+ {{ form.as_p }}
+ <input type="submit" value="Submit" />
+ </form>
+</body>
+</html>
View
@@ -0,0 +1,9 @@
+from django.views.generic import UpdateView
+from .models import ParkingArea
+
+
+class ParkingAreaUpdate(UpdateView):
+ model = ParkingArea
+
+
+parkingarea_update = ParkingAreaUpdate.as_view()
View
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
-import os
from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
@@ -20,5 +19,6 @@ def handle500(request):
urlpatterns = patterns('',
url(r'^media/(.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
url(r'^admin/', include(admin.site.urls), name="admin"),
- url(r'^', include('staticfiles.urls')),
+ url(r'^parkingarea/(?P<pk>\d+)/$', 'example.testapp.views.parkingarea_update', name='parkingarea'),
+ url(r'^', include('django.contrib.staticfiles.urls')),
)

0 comments on commit e4d099d

Please sign in to comment.