Sorry to hijack the thread somewhat, but where can I find out how to use blobstore simply to upload large files with web2py?
Thanks, Tris On May 4, 1:41 am, mdipierro <mdipie...@cs.depaul.edu> wrote: > You can do > > form = SQLFORM(db.artwork, request.args[0], fields=fields, > upload=URL(r=request, c='gae', > f='preview'),_action=....) > > On May 3, 4:11 pm, howesc <how...@umich.edu> wrote: > > > > > Hello, > > > Is it intentional that when using SQLFORM, and custom views (with > > form.custom.begin), that if i modify attributes after initial form > > construction I have to update form.custom.begin myself? > > > here's my example: > > > form = SQLFORM(db.artwork, request.args[0], fields=fields, > > upload=URL(r=request, c='gae', f='preview')) > > > if request.env.web2py_runtime_gae: > > fromgoogle.appengine.ext importblobstore > > upload_url = > >blobstore.create_upload_url(URL(r=request,f='upload_art', > > args=request.args, > > > vars={'redir':URL(r=request,c='account', f='index')})) > > > form['_action']=upload_url > > (begin, end) = form._xml() > > form.custom.begin = XML("<%s %s>" % (form.tag, begin)) > > > note that if i don't update form.custom.begin myself it does not > > include the '_action' attribute. In most cases you just initialize > > the form with all the needed attributes, but in this case if i'm on > >googleappenginei need the upload field to post to another URL > > (since i'm usingblobstore), but if i'm not on GAE i can use the > > regular action. > > > I suppose at this point theapponly runs on GAE, so i can just skip > > the if statement, but thought this might be a low-priority bug. > > > thanks, > > > christian