How to pass in a file to a model directly

2010-09-15 Thread Yo-Yo Ma
I'm wondering how to do this: instance = SomeModelWithFile.objects.create( file = some_file, spam="Spam", foo="Foo" ) How can I manually pass in a file like this? In file=some_file should some_file be a FileUpload instance? How do I create one of those? -- You received this mes

Re: How to pass in a file to a model directly

2010-09-15 Thread Yo-Yo Ma
Anyone? On Sep 15, 1:18 pm, Yo-Yo Ma wrote: > I'm wondering how to do this: > > instance = SomeModelWithFile.objects.create( >     file = some_file, >     spam="Spam", >     foo="Foo" > ) > > How can I manually pass in a file like this? In file=some_file should > some_file be a FileUpload ins

Re: How to pass in a file to a model directly

2010-09-15 Thread nick.l...@gmail.com
Have you looked at this yet? http://docs.djangoproject.com/en/dev/topics/files/#the-file-object n On Wed, Sep 15, 2010 at 7:18 PM, Yo-Yo Ma wrote: > I'm wondering how to do this: > > > instance = SomeModelWithFile.objects.create( >file = some_file, >spam="Spam", >foo="Foo" > ) >