title: Django file upload: filename not sticking
body: <p>I'm uploading files and storing metadata in a db.  Part of the metadata is the file name itself.  However, somewhere down the line, the filename seems to not be getting saved!  I will paste only what I think are relevant parts of the code to keep this short.</p>
  
  <pre><code>class UploadFile(models.Model):
     ...
      theFile = models.FileField(upload_to = "Genius/Uploads/", null = True)
      filename = models.CharField(max_length = 50, blank = True, null = False)
  
  class UploadFileForm(ModelForm):
      class Meta:
          model = UploadFile
          fields = ('title', 'theFile', 'date_uploaded',) # Don't prompt for filename
  
  
  def files_upload(request):
      if request.method == 'POST':
          form = UploadFileForm(request.POST, request.FILES)
          if form.is_valid():
              form.filename = request.FILES['theFile'].name # TODO: sanitize!
              # form.filename = 'foo'
              form.save()
              return HttpResponseRedirect('/files/upload/successful/')
          else:
              form = UploadFileForm()
          return render_to_response('files/upload_file.html', { 'form': form })
  </code></pre>
  
  <p>I have checked the value of request.FILES['theFile'].name before &amp; after saving the form.  For whatever reason it is intact but never seems to make it into the DB.</p>