title: Django Serializer: How can I validate a model instance?
body: <p>I'm pretty new to Django Serializers and still confused on how they work.</p>
  
  <p>I have a fairly general scenario wherein I'm calling my api which simply sets a field in my model object and saves it (assume the record is already present and it is just being updated). However, I need to validate this model object before saving it. </p>
  
  <p><strong>api.py</strong></p>
  
  <pre><code>@detail_route(methods=['POST'], url_path='submit-draft')
  def submit_draft(self, request, *args, **kwargs):
      booking = self.get_object()
  
      # serializer with custom validations.
      serializer = self.get_serializer(booking)
      serializer.is_valid(raise_exception=True)
  
      booking.submit_draft(by=request.user)
      booking.save()
  
      data = serializers.BookingDetailSerializer(booking, context={'request': request}).data
  
      return response.Ok(data)
  </code></pre>
  
  <p><strong>serializers.py</strong></p>
  
  <pre><code>class BookingCreateUpdateSerializer(serializers.ModelSerializer):
      date = serializers.CharField()
  
      duration = serializers.IntegerField(required=True, )
  
      created_by = serializers.PrimaryKeyRelatedField(read_only=True, default=serializers.CurrentUserDefault(), )
  
      modified_by = serializers.PrimaryKeyRelatedField(read_only=True, default=serializers.CurrentUserDefault(), )
      ....
  
      class Meta:
      model = models.Booking
          fields = [
          'title',
          'date',
          'duration',
          'client',
          'created_by',
          'modified_by',
          ....
      ]
  </code></pre>
  
  <p>However, I get this error:</p>
  
  <p><code>AssertionError: Cannot call '.is_valid()' as no 'data=' keyword argument was passed when instantiating the serializer instance.</code></p>
  
  <p>I understand that the serializer is expecting a dictionary rather than the actual modal object. But I can't figure out how to achieve what I want to ie. validate a model object. Can anyone please suggest the right approach?</p>