Skip to content

Instantly share code, notes, and snippets.

@girasquid
Created December 9, 2011 20:59
Show Gist options
  • Save girasquid/1453265 to your computer and use it in GitHub Desktop.
Save girasquid/1453265 to your computer and use it in GitHub Desktop.
How to save a file to a FileField in Django without writing the entire row.
instance.file_field.save(the_filename, file_content, save=False)
MyModel.objects.filter(id=instance.id).update(file_field=instance.file_field)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment