title: Django - which create() method to override before saving incoming data as object
body: <p>I have the following model in my <code>models.py</code> file: </p>
  
  <pre><code>class Video(models.Model):
      created = models.DateTimeField(auto_now_add=True)
      text = models.CharField(max_length=100, blank=True)
      video = models.FileField(upload_to='Videos/',
                                blank=True)
      gif = models.FileField(upload_to='Images/',
                                blank=True)
  
      class Meta:
          ordering = ('created', )
  </code></pre>
  
  <p>Before Django creates an instance of this model, I want to set the <code>gif</code> field on the Django site.
  So, the data comes to Django from the client site with the field <code>video</code> set, and based on the <code>video</code> field's content I want to fill the <code>gif</code> field.</p>
  
  <p>For that, which <code>create()</code> method do I need to override for this task? 
  The <code>create()</code> method of my <code>VideoSerializer</code> class in <code>serializers.py</code> :</p>
  
  <pre><code>def create(self, validated_data):
          return Video(**validated_data)
  </code></pre>
  
  <p>Or the create() method of my <code>VideoCreate</code> class in <code>views.py</code>: </p>
  
  <pre><code>class VideoCreate(generics.CreateAPIView):
      queryset = Video.objects.all()
      serializer_class = VideoSerializer
      parser_classes = (MultiPartParser, )
  
      def create(self, request, *args, **kwargs):
  
          serializer = self.get_serializer(data=request.data)
          serializer.is_valid(raise_exception=True)
          self.perform_create(serializer)
          headers = self.get_success_headers(serializer.data)
          return Response(serializer.data, status=status.HTTP_201_CREATED, headers=headers)
  </code></pre>
  
  <p>Hope someone can help</p>