Permalink
Browse files

Adding initial RESTful api urls for fixmystreet.

  • Loading branch information...
1 parent def16eb commit 1413d0f6c4b22b6152bfc76a133ce43c7fbea7c1 @pykler committed Jul 31, 2009
Showing with 22 additions and 0 deletions.
  1. +22 −0 urls.py
View
22 urls.py
@@ -78,6 +78,28 @@
urlpatterns += patterns('mainapp.views.ajax',
(r'^ajax/categories/(\d+)', 'category_desc'),
)
+
+# REST
+json_report_resource = Collection(
+ queryset = Report.objects.all(),
+ permitted_methods = ('GET', 'POST'),
+# expose_fields = ('id','point'),
+ responder = JSONResponder()
+# responder = JSONResponder(paginate_by = 2)
+)
+
+json_reportupdate_resource = Collection(
+ queryset = ReportUpdate.objects.all(),
+ permitted_methods = ('GET', 'POST'),
+ responder = JSONResponder()
+ #responder = JSONResponder(paginate_by = 10)
+)
+
+urlpatterns += patterns('',
+ url(r'^json/report/(.*?)/?$', json_report_resource),
+ url(r'^json/reportupdate/(.*?)/?$', json_reportupdate_resource),
+)
+
#The following is used to serve up local media files like images
if settings.LOCAL_DEV:

0 comments on commit 1413d0f

Please sign in to comment.