title: Creating multiple objects with one request in Django and Django Rest Framework
body: <p>I am using Django as the backend server and Vue.js for the front end Movie app.</p>
  
  <p>I have a Ticket model</p>
  
  <pre><code>class MovieTicket(models.Model):
      show = models.ForeignKey(Show)
      seat = models.ForeignKey(Seat)
      user = models.ForeignKey(User)
      purchased_at = models.DateTimeField(default=timezone.now)
      qrcode = models.ImageField(upload_to='qrcode', blank=True, null=True)
      qrcode_data = models.CharField(max_length=255, unique=True, blank=True)
  
      class Meta:
          unique_together = ('show', 'seat')
  </code></pre>
  
  <p>And its related Serializer</p>
  
  <pre><code>class MovieTicketSerializer(serializers.ModelSerializer):
      class Meta:
          model = MovieTicket
          fields = '__all__'
  </code></pre>
  
  <p>To buy a new Ticket there's a view which is mapped to this url <em><a href="http://dev.site.com/api/movies/buy-ticket/" rel="noreferrer">http://dev.site.com/api/movies/buy-ticket/</a>:</em></p>
  
  <pre><code>@api_view(['POST'])
  @permission_classes([IsAuthenticated])
  def buy_ticket(request):
      serialized = MovieTicketSerializer(data=request.data)
      if serialized.is_valid():
          serialized.save()
          return Response(serialized.data, status=status.HTTP_201_CREATED)
      return Response(serialized._errors, status=status.HTTP_400_BAD_REQUEST)
  </code></pre>
  
  <p>Now from the front end (Vue.js) I can create a new movie ticket:</p>
  
  <pre><code>const formBody = {
      show: this.$store.state.showSelected.showTime.id,
      user: this.$store.state.user.id,
  
      // selectedSeats is an array of seats that have been selected by the user. Here I am passing the first seat object.
      seat: this.$store.state.selectedSeats[0].seat.id
  };
  
  this.$http.post("http://dev.site.com/api/movies/buy-ticket/", formBody)
      .then(function (response) {
          console.log(response.data);
      })
      .catch(function (response) {
          console.log(response);
      });
  return;
  </code></pre>
  
  <p>If the form was valid, this will create a new MovieTicket Object, or else show the error/s.</p>
  
  <p>Now, suppose if the user selected multiple seats, I can loop through each <code>selectedSeats</code> array and get the seat ids on the client side. And post something like this:</p>
  
  <pre><code>{
      "purchased_at": null,
      "qrcode": null,
      "qrcode_data": "",
      "show": 11,
      "seat": [
          106,
          219
      ],
      "user": 34
  }
  </code></pre>
  
  <p>But what I am confused is how can I pass multiple <code>seat.id</code> if Django rest framework is only accepting one seat per request and display errors accordingly? Meaning display errors if a ticket is available or not, and if its available create movie tickets for that show-seat.</p>