diff options
| author | tom christie tom@tomchristie.com | 2011-01-30 11:00:20 +0000 |
|---|---|---|
| committer | tom christie tom@tomchristie.com | 2011-01-30 11:00:20 +0000 |
| commit | 250ab0f609f32cd3e004e1f2711f9c2e4fd9b57c (patch) | |
| tree | 915eeda0528dab3159958500c117e9285bc56ef3 /docs/examples/blogpost.rst | |
| parent | 40f47a9fb31aebd965dce03ae57c036d5360d124 (diff) | |
| download | django-rest-framework-250ab0f609f32cd3e004e1f2711f9c2e4fd9b57c.tar.bz2 | |
Lots of docs, trying to tidy up examples...
Diffstat (limited to 'docs/examples/blogpost.rst')
| -rw-r--r-- | docs/examples/blogpost.rst | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/docs/examples/blogpost.rst b/docs/examples/blogpost.rst new file mode 100644 index 00000000..067a6bb3 --- /dev/null +++ b/docs/examples/blogpost.rst @@ -0,0 +1,29 @@ +ModelResource example - Blog posts +================================== + +The models +---------- + +``models.py`` + +.. include:: ../../examples/blogpost/models.py + :literal: + +URL configuration +----------------- + +``urls.py`` + +.. include:: ../../examples/blogpost/urls.py + :literal: + +Creating the resources +---------------------- + +Once we have some existing models there's very little we need to do to create the corresponding resources. We simply create a base resource and an instance resource for each model we're working with. +django-rest-framework will provide the default operations on the resources all the usual input validation that Django's models can give us for free. + +``views.py`` + +.. include:: ../../examples/blogpost/views.py + :literal:
\ No newline at end of file |
