[web2py] Re: uploading files on GAE - 404 NOT FOUND

2013-12-17 Thread Alan Etkin


 Are there meant to be limitations around compute on GAE?


I don't think so, this could be a bug. Please file an issue and we'll try 
to reproduce and fix it.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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.


[web2py] Re: uploading files on GAE - 404 NOT FOUND

2013-12-05 Thread James Burke
Hi Christian,

Thanks for your help.

Unfortunately no ticket is created I just get a new page with the 404 error 
message on it.

url when uploading the file: http://gic-test.appspot.com/admin/file/new/file
url after uploading the 
file: http://gic-test.appspot.com/admin/file/new/file#

I've located the code that is causing the error in:

db.define_table('file',
Field('name', unique=True, compute=lambda r: db.file.file.retrieve(r.
file)[0]),
Field('file', 'upload'),
Field('created_on', 'datetime', default=request.now),
Field('created_by', 'reference auth_user', default=auth.user_id),
format='%(name)s')


the compute function for name lambda r: db.file.file.retrieve(r.file)[0] when 
removed fixes the error. Although this code works with rocket web server.

Cheers

-James



On Thursday, December 5, 2013 7:29:20 PM UTC+13, Christian Foster Howes 
wrote:

 Can you share the log/stack trace from when that happens?  does the form 
 post to the same function that generated it?

 i have not tried upload in grid()wonder if there is something there 
 that doesn't quite work on app engine?

 On Tuesday, December 3, 2013 10:49:47 AM UTC-8, James Burke wrote:

 Hi,

 Uploading files into my table on GAE, when I hit submit I'm presented 
 with a 404 NOT FOUND error message.

 Works fine using Rocket, but not in GAE SDK or when uploaded to GAE.

 _tables.py - in models
 db.define_table('file',
 Field('name', unique=True, compute=lambda r: db.file.file.retrieve(r.
 file)[0]),
 Field('file', 'upload'),
 Field('created_on', 'datetime', default=request.now),
 Field('created_by', 'reference auth_user', default=auth.user_id),
 format='%(name)s')


 admin.py - in controllers
 @auth.requires_membership(admin)
 def file():
  links = [dict(header='URL', body=lambda row: '/init/default/download/%s' 
 %(db.file.file.retrieve(row.file)[0]))]
  form = SQLFORM.grid(db.file, links=links, searchable=False, 
 csv=False,user_signature
 =False)


  return dict(form=form)



 Cheers

 -James



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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.


[web2py] Re: uploading files on GAE - 404 NOT FOUND

2013-12-04 Thread Christian Foster Howes
Can you share the log/stack trace from when that happens?  does the form 
post to the same function that generated it?

i have not tried upload in grid()wonder if there is something there 
that doesn't quite work on app engine?

On Tuesday, December 3, 2013 10:49:47 AM UTC-8, James Burke wrote:

 Hi,

 Uploading files into my table on GAE, when I hit submit I'm presented with 
 a 404 NOT FOUND error message.

 Works fine using Rocket, but not in GAE SDK or when uploaded to GAE.

 _tables.py - in models
 db.define_table('file',
 Field('name', unique=True, compute=lambda r: db.file.file.retrieve(r.
 file)[0]),
 Field('file', 'upload'),
 Field('created_on', 'datetime', default=request.now),
 Field('created_by', 'reference auth_user', default=auth.user_id),
 format='%(name)s')


 admin.py - in controllers
 @auth.requires_membership(admin)
 def file():
  links = [dict(header='URL', body=lambda row: '/init/default/download/%s' 
 %(db.file.file.retrieve(row.file)[0]))]
  form = SQLFORM.grid(db.file, links=links, searchable=False, 
 csv=False,user_signature
 =False)


  return dict(form=form)



 Cheers

 -James


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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.