Custom function which performs create and update on DRF modelViewSet
<p>Hi there I want to create a custom method in a <code>modelviewset</code> which needs to perform a save and an update logic in a single post request.</p>

<p>Here is my <code>breeding.viewsets.py</code></p>

<pre><code>class BreedingViewSet(viewsets.ModelViewSet):
    queryset = Breeding.objects.all()
    serializer_class = BreedingSerializer
</code></pre>

<blockquote>
  <p>Since the above method has a higher level of abstraction and is
  actually  providing or performing automatic CRUD functions.</p>
</blockquote>

<p><strong>Now the problem here is i dont have any control for a multiple queries like saving an object and updating another object in a single post request.</strong> </p>

<p>e.g</p>

<pre><code>def save_and_update(self, request):
     // do save an object here.
     // do update an object here.
</code></pre>

<p>How can we achieve such powerful functionalities? Did i missed something? I found this <a href="http://www.django-rest-framework.org/api-guide/viewsets/#marking-extra-actions-for-routing" rel="noreferrer">documentation</a> but i dont know how to implement the given instruction.</p>

<p><strong>UPDATE</strong></p>

<p>This is what im looking for <a href="https://stackoverflow.com/questions/14666199/how-do-i-create-multiple-model-instances-with-django-rest-framework">How do I create multiple model instances with Django Rest Framework?</a></p>

<p>But the answer can only <code>save</code> a multiple instances in a single post request of that same model. But Im hoping also that we can perform queries for a different models in that single function.</p>