aboutsummaryrefslogtreecommitdiffstats
path: root/src/testapp/views.py
diff options
context:
space:
mode:
authortom christie tom@tomchristie.com2010-12-30 01:02:11 +0000
committertom christie tom@tomchristie.com2010-12-30 01:02:11 +0000
commit8a12f89aaacfc0839d6ab1e62b4b5046930517ba (patch)
tree3f0b4fd095d93c5b003832b5e19ecf7f670924ab /src/testapp/views.py
parent650111dc8c0800e5b7d4c878c1d454657b68efca (diff)
downloaddjango-rest-framework-8a12f89aaacfc0839d6ab1e62b4b5046930517ba.tar.bz2
Added tests
Diffstat (limited to 'src/testapp/views.py')
-rw-r--r--src/testapp/views.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/testapp/views.py b/src/testapp/views.py
new file mode 100644
index 00000000..f0174414
--- /dev/null
+++ b/src/testapp/views.py
@@ -0,0 +1,21 @@
+from decimal import Decimal
+from rest.resource import Resource
+
+class ReadOnlyResource(Resource):
+ """This is my docstring
+ """
+ allowed_methods = ('GET',)
+
+ def read(self, headers={}, *args, **kwargs):
+ return (200, {'ExampleString': 'Example',
+ 'ExampleInt': 1,
+ 'ExampleDecimal': 1.0}, {})
+
+
+class MirroringWriteResource(Resource):
+ """This is my docstring
+ """
+ allowed_methods = ('PUT',)
+
+ def create(self, data, headers={}, *args, **kwargs):
+ return (200, data, {})