<p>Because the behavior of nested creates and updates can be ambiguous, and may require complex dependancies between related models, REST framework 3 requires you to always write these methods explicitly. The default <code>ModelSerializer</code><code>.create()</code> and <code>.update()</code> methods do not include support for writable nested representations.</p>
<p>Because the behavior of nested creates and updates can be ambiguous, and may require complex dependancies between related models, REST framework 3 requires you to always write these methods explicitly. The default <code>ModelSerializer</code><code>.create()</code> and <code>.update()</code> methods do not include support for writable nested representations.</p>
<p>It is possible that a third party package, providing automatic support some kinds of automatic writable nested representations may be released alongside the 3.1 release.</p>
<p>It is possible that a third party package, providing automatic support some kinds of automatic writable nested representations may be released alongside the 3.1 release.</p>
<h2id="setting-up-a-new-environment">Setting up a new environment</h2>
<h2id="setting-up-a-new-environment">Setting up a new environment</h2>
<p>Before we do anything else we'll create a new virtual environment, using <ahref="http://www.virtualenv.org/en/latest/index.html">virtualenv</a>. This will make sure our package configuration is kept nicely isolated from any other projects we're working on.</p>
<p>Before we do anything else we'll create a new virtual environment, using <ahref="http://www.virtualenv.org/en/latest/index.html">virtualenv</a>. This will make sure our package configuration is kept nicely isolated from any other projects we're working on.</p>
<pre><code>:::bash
<pre><code>virtualenv env
virtualenv env
source env/bin/activate
source env/bin/activate
</code></pre>
</code></pre>
<p>Now that we're inside a virtualenv environment, we can install our package requirements.</p>
<p>Now that we're inside a virtualenv environment, we can install our package requirements.</p>
...
@@ -460,12 +459,8 @@ class Snippet(models.Model):
...
@@ -460,12 +459,8 @@ class Snippet(models.Model):
title = models.CharField(max_length=100, blank=True, default='')
title = models.CharField(max_length=100, blank=True, default='')
code = models.TextField()
code = models.TextField()
linenos = models.BooleanField(default=False)
linenos = models.BooleanField(default=False)
language = models.CharField(choices=LANGUAGE_CHOICES,
language = models.CharField(choices=LANGUAGE_CHOICES, default='python', max_length=100)