I've added the optional arguments to my field, and created the functions as described. However I'm getting the error: <type 'exceptions.NameError'> name 'store_file' is not defined Do the functions need to live in a specific location in order to be recognized?
I looked through the book but I didn't see an example of these in practice. The example I was looking at is on stack over flow: http://stackoverflow.com/a/8185933 Thanks On Monday, January 17, 2011 11:09:08 AM UTC-6, Massimo Di Pierro wrote: > > You can pass two optional arguments to Field(...) > > custom_store and custom_retrieve > > the first must be a function that takes a file like object, a > filename, and an optional path (uploadfolder) stores the file where > you like and returns the filename you assign to the file (can be the > original one) > > custom_retrieve instead takes a filename and a path (uploadfolder) and > return the file content. > > Massimo > > On Jan 17, 8:36 am, grezly <d.jan...@foxi.nl> wrote: > > I'd like to change the default behaviour for one app, concerning my > > uploads. Web2py normally rename the uploaded file, but in my > > particular case, web2py doesn't need to change my filename. > > > > Is something possible, while creating my model? > > > > Next to that i also like to store a hash of a file in my database. > > With the standard crud i can't change this behaviour. > > I also can't find such a functionality right now in web2py/crud, or > > did i miss something? -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.