Updated doc examples to open using read binary mode
This commit is contained in:
		| @@ -20,7 +20,7 @@ a document is created to store details about animals, including a photo:: | ||||
|  | ||||
|     marmot = Animal(genus='Marmota', family='Sciuridae') | ||||
|  | ||||
|     marmot_photo = open('marmot.jpg', 'r') | ||||
|     marmot_photo = open('marmot.jpg', 'rb') | ||||
|     marmot.photo.put(marmot_photo, content_type = 'image/jpeg') | ||||
|     marmot.save() | ||||
|  | ||||
| @@ -70,5 +70,5 @@ Replacing files | ||||
| Files can be replaced with the :func:`replace` method. This works just like | ||||
| the :func:`put` method so even metadata can (and should) be replaced:: | ||||
|  | ||||
|     another_marmot = open('another_marmot.png', 'r') | ||||
|     another_marmot = open('another_marmot.png', 'rb') | ||||
|     marmot.photo.replace(another_marmot, content_type='image/png') | ||||
|   | ||||
		Reference in New Issue
	
	Block a user