I found the answer in this discussion:
http://groups.google.com/group/django-users/browse_frm/thread/184e5e09db1efce4/7816cbc650d8dc77
Pass in the filename and content to the FileField's save() method
directly, rather than using the model instance's save() method.
On Dec 14, 2:24 pm, Brian S wr
Could someone point me in the right direction on how to save a file
object to a FileField in a model? When I try assigning the file object
directly to the FileField field, I get an atrribute error:
myfile = open('/home/sample.txt', 'wb')
mymodelinstance.resultFile=myfile
mymodelinstance.save()
--
2 matches
Mail list logo