[web2py] Re: Image store with open does not work on GAE

2013-02-08 Thread Massimo Di Pierro
Definitively it will be fixed. It is in the todo list. I opened a ticket about it. :-) On Friday, 8 February 2013 05:18:38 UTC-6, Sebastian Cambeo wrote: > > So is there any hope that this can be fixed? Maybe you can rely on my > workaround as posted above: > > file = open('test.jpg', 'rb') >> t

[web2py] Re: Image store with open does not work on GAE

2013-02-08 Thread Sebastian Cambeo
So is there any hope that this can be fixed? Maybe you can rely on my workaround as posted above: file = open('test.jpg', 'rb') > tmpId = db.table1.insert(image = file) > if request.env.web2py_runtime_gae: > db(db.table1.id==tmpId).update(image_blob = file.read()) > > -- --- You received

[web2py] Re: Image store with open does not work on GAE

2013-02-07 Thread Massimo Di Pierro
Clearly something is not working as intended. There are two cases here: 1) the blob is saved in the same table as the unload field: db.define_table('table1', Field('image', 'upload'), ) In this case the blob field is created automatically. 2) the blob is created in a separate table: db.defi

[web2py] Re: Image store with open does not work on GAE

2013-02-07 Thread Alan Etkin
>> Field('image', 'upload'), Why two upload fields? Shouldn't the first table have a blob type field? -- --- 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 web2

[web2py] Re: Image store with open does not work on GAE

2013-02-07 Thread Sebastian Cambeo
unfortunately not: TRACEBACK 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. Traceback (most recent call last): File "*\restricted.py", line 212, in restricted exec ccode in environment File "*/applications/welcome/models/db.py" , lin

[web2py] Re: Image store with open does not work on GAE

2013-02-06 Thread Massimo Di Pierro
We can solve this but the internal logic is going to be convoluted. The problem is that you cannot read the content after then record has been created and not before. Can you help me test something? db.define_table('blobs', Field('image', 'upload'), ) db.define_table('table1', Field('image', 'up

[web2py] Re: Image store with open does not work on GAE

2013-02-05 Thread Massimo Di Pierro
Please open a ticket about this and link to this page. This should definitively be done automatically. It is a web2py bug if it does not. On Monday, 4 February 2013 17:24:47 UTC-6, Sebastian Cambeo wrote: > > yes it does work ok GAE ;) > > I am using currently the following workaround, but this s

[web2py] Re: Image store with open does not work on GAE

2013-02-04 Thread Sebastian Cambeo
yes it does work ok GAE ;) I am using currently the following workaround, but this should obviously be handled by web2py and not by me, so please fix this: file = open('test.jpg', 'rb') tmpId = db.table1.insert(image = file) if request.env.web2py_runtime_gae: db(db.table1.id==tmpId).update

[web2py] Re: Image store with open does not work on GAE

2013-02-04 Thread c h
I think the problem is with the open(), i'm not sure that works at all on GAE, and/or the path to the file is not what you expect. I'm not sure how to pragmatically insert an image into the datastore. On Sunday, February 3, 2013 1:30:20 AM UTC-8, Sebastian Cambeo wrote: > > OK, I created a mini

[web2py] Re: Image store with open does not work on GAE

2013-02-03 Thread Sebastian Cambeo
OK, I created a minimal scenario for reproducing the error: append these lines to the welcome db.py, create test.jpg in root folder and deploy directly to GAE: db.define_table('table1', Field('image', 'upload'), ) db.table1.insert(image = open('test.jpg', 'rb')) Then call welcome/appadmin and

[web2py] Re: Image store with open does not work on GAE

2013-02-02 Thread Massimo Di Pierro
This should work fine on GAE. Please show us your exact model. Are you testing with SDK? On Saturday, 2 February 2013 04:33:56 UTC-6, Sebastian Cambeo wrote: > > The following line of code works perfectly well locally (no GAE): > > db.table1.insert(image = open('test.jpg', 'rb') > > However it d