Re: Save file object to FileField

2009-12-17 Thread Brian S
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

Save file object to FileField

2009-12-14 Thread Brian S
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() --