I think it almost works. :) The uploaded files were redirected to the
gallery_images table, but when I try to display them using the
download function, the app can't retrieve them. I get the following
error:

Traceback (most recent call last):
  File "/base/data/home/apps/scalpellino-manufactory/
3.345245272823609875/gluon/restricted.py", line 188, in restricted
    exec ccode in environment
  File "/base/data/home/apps/scalpellino-manufactory/
3.345245272823609875/applications/init/controllers/
gallery.py:download", line 90, in <module>
  File "/base/data/home/apps/scalpellino-manufactory/
3.345245272823609875/gluon/globals.py", line 96, in <lambda>
    self._caller = lambda f: f()
  File "/base/data/home/apps/scalpellino-manufactory/
3.345245272823609875/applications/init/controllers/
gallery.py:download", line 88, in download
  File "/base/data/home/apps/scalpellino-manufactory/
3.345245272823609875/gluon/globals.py", line 196, in download
    (filename, stream) = field.retrieve(name)
  File "/base/data/home/apps/scalpellino-manufactory/
3.345245272823609875/gluon/sql.py", line 2865, in retrieve
    data = self.uploadfield._table(query)[blob_uploadfield_name]
TypeError: 'NoneType' object is unsubscriptable

István

On Oct 2, 10:01 pm, mdipierro <[email protected]> wrote:
> hmm. a GAE thing. I think it is fixed now. One more test please.
>
> On Oct 2, 11:44 am, István Gazsi <[email protected]> wrote:
>
>
>
>
>
>
>
> > I have tried it on GAE, but it looks like it uses the gallery table
> > instead of the gallery_images table, so the uploaded files are not
> > redirected to the other db table.
>
> > On Oct 1, 9:58 pm, István Gazsi <[email protected]> wrote:
>
> > > It's great now it works! :) Thank you very much. I will test it on GAE
> > > as soon as I can and I'll post the results here.
>
> > > Have a nice day!
>
> > > István
>
> > > On Oct 1, 9:18 pm, mdipierro <[email protected]> wrote:
>
> > > > Now I think I fixed it. This time I tried it. Please double check.
> > > > Notice you can have a single table with all your files and more than
> > > > one record from different tables use that as uploadfield.
>
> > > > Massimo
>
> > > > On Oct 1, 1:29 pm, István Gazsi <[email protected]> wrote:
>
> > > > > I've made a little mistake, because I added the uploadfield option to
> > > > > another field, but it didn't cause any problem. But it looks like when
> > > > > I upload a file into the redirected field (the one with the
> > > > > uploadfield option) web2py still doesn't create a new record in the
> > > > > gallery_images table, and it can't load the image later. Here is the
> > > > > traceback:
>
> > > > > Traceback (most recent call last):
> > > > >   File "/home/istvan/Documents/Mercurial/web2py-trunk-test/gluon/
> > > > > restricted.py", line 188, in restricted
> > > > >     exec ccode in environment
> > > > >   File "/home/istvan/Documents/Mercurial/web2py-trunk-test/
> > > > > applications/init/controllers/gallery.py", line 90, in <module>
> > > > >   File "/home/istvan/Documents/Mercurial/web2py-trunk-test/gluon/
> > > > > globals.py", line 96, in <lambda>
> > > > >     self._caller = lambda f: f()
> > > > >   File "/home/istvan/Documents/Mercurial/web2py-trunk-test/
> > > > > applications/init/controllers/gallery.py", line 88, in download
> > > > >     return response.download(request,db,attachment=False)
> > > > >   File "/home/istvan/Documents/Mercurial/web2py-trunk-test/gluon/
> > > > > globals.py", line 196, in download
> > > > >     (filename, stream) = field.retrieve(name)
> > > > >   File "/home/istvan/Documents/Mercurial/web2py-trunk-test/gluon/
> > > > > sql.py", line 2865, in retrieve
> > > > >     data = self.uploadfield._table(query)[blob_uploadfield_name]
> > > > > TypeError: 'NoneType' object is unsubscriptable
>
> > > > > And I'm really thankful for your hard work and help. :)
>
> > > > > István
>
> > > > > On Oct 1, 8:05 pm, mdipierro <[email protected]> wrote:
>
> > > > > > one more try please
>
> > > > > > On Oct 1, 11:52 am, István Gazsi <[email protected]> wrote:
>
> > > > > > > I forgot to mention that I inserted a record into the gallery 
> > > > > > > table. :)

Reply via email to