aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/tests/models.py
diff options
context:
space:
mode:
authorIan Strachan2012-10-22 22:24:26 +0100
committerIan Strachan2012-10-22 22:24:26 +0100
commitc7a0d52fd7e22fbc4a01ff900bd3b2c1215e984d (patch)
tree164bc17f49ff80155edf846e94855369b8228878 /rest_framework/tests/models.py
parentaba0172f5c988af145113678fe3d4f411111d4ff (diff)
downloaddjango-rest-framework-c7a0d52fd7e22fbc4a01ff900bd3b2c1215e984d.tar.bz2
#314 Fix for manytomany field being required in the payload even though the field is specified as readonly in the serializer
Diffstat (limited to 'rest_framework/tests/models.py')
-rw-r--r--rest_framework/tests/models.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/rest_framework/tests/models.py b/rest_framework/tests/models.py
index 8e721737..97cd0849 100644
--- a/rest_framework/tests/models.py
+++ b/rest_framework/tests/models.py
@@ -62,7 +62,12 @@ class CallableDefaultValueModel(RESTFrameworkModel):
class ManyToManyModel(RESTFrameworkModel):
rel = models.ManyToManyField(Anchor)
+
+class ReadOnlyManyToManyModel(RESTFrameworkModel):
+ text = models.CharField(max_length=100, default='anchor')
+ rel = models.ManyToManyField(Anchor)
+
# Models to test generic relations