diff options
| author | Jamie Matthews | 2012-10-22 15:12:25 +0100 |
|---|---|---|
| committer | Jamie Matthews | 2012-10-22 15:12:25 +0100 |
| commit | 45d4622f090f8d81a04b4d3e888017419676bbc0 (patch) | |
| tree | be8123972b230c118709a70cda0dd746c91645e2 /rest_framework/tests/models.py | |
| parent | d53ee8a10c5fd3c95a577a409d39a394a838b0b7 (diff) | |
| download | django-rest-framework-45d4622f090f8d81a04b4d3e888017419676bbc0.tar.bz2 | |
Fix serialization of reverse relationships
Diffstat (limited to 'rest_framework/tests/models.py')
| -rw-r--r-- | rest_framework/tests/models.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/rest_framework/tests/models.py b/rest_framework/tests/models.py index 75dab2f7..8e721737 100644 --- a/rest_framework/tests/models.py +++ b/rest_framework/tests/models.py @@ -92,6 +92,17 @@ class Comment(RESTFrameworkModel): content = models.CharField(max_length=200) created = models.DateTimeField(auto_now_add=True) + class ActionItem(RESTFrameworkModel): title = models.CharField(max_length=200) done = models.BooleanField(default=False) + + +# Models for reverse relations +class BlogPost(RESTFrameworkModel): + title = models.CharField(max_length=100) + + +class BlogPostComment(RESTFrameworkModel): + text = models.TextField() + blog_post = models.ForeignKey(BlogPost) |
