title: Django: How to replace/overwrite/update/change a file of FileField?
body: <p>In Django, I have the following model:</p>
  
  <pre><code>from django.db import models
  from django.core.files.base import File
  import os, os.path
  
  class Project(models.Model):
      video = models.FileField(upload_to="media")
  
      def replace_video(self):
          """Convert video to WebM format."""
          # This is where the conversion takes place,
          # returning a path to the new converted video
          # that I wish to override the old one.
          video_path = convert_video()
  
          # Replace old video with new one,
          # and remove original unconverted video and original copy of new video.
          self.video.delete(save=True)
          self.video.save(os.path.basename(video_path), File(open(video_path ,"wb")), save=True)
          os.remove(video_path)
  </code></pre>
  
  <p>I want to be able to <em>replace</em> the file in the FileField <em>video</em> on a model object/instance. The above method I've written does not work. Once I delete the original file, I get the following error:</p>
  
  <pre><code>ValueError: The 'video' attribute has no file associated with it.
  </code></pre>
  
  <p>How can I replace the file with an updated one, and remove the original one (no more necessary)?</p>
  
  <p><em>Side-Note</em>: I have found a <a href="https://stackoverflow.com/q/4394194/207894">related issue</a>, but with no satisfying answer.</p>