Created
December 9, 2011 20:59
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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