Strange. Can you plese

print db.pictures.fields()
print db.pictures.image.uploadfield
print db._adapter.uploads_in_blob

what's the output?



In gluon/dal.py there is this line:

        if db and self._db._adapter.uploads_in_blob==True or
            for field in fields:
                if isinstance(field, Field) and field.type == 'upload'\
                        and field.uploadfield is True:
                    tmp = field.uploadfield = '%s_blob' % field.name
                    fields.append(self._db.Field(tmp, 'blob',
default=''))

It should  add a blob field to the pictures table.


On Dec 25, 11:54 am, "Arun K.Rajeevan" <[email protected]> wrote:
> restlessly trying again and again
>
> db.pictures.insert(image = db.pictures.image.store(form.vars.image.file,
> form.vars.image.filename)
>
> worked fine while I'm running web2py stand alone.
>
> But as soon as I try to run it through GAE, it cause error.
> INSERT seems working, except, file is stored some unknown place. I'm not
> getting reference to the file later on.
>
> From console, these are error
> -------------------------------------------------------------------------------------------------------------------------------------------------------------
> INFO     2010-12-26 04:12:56,216 dev_appserver.py:3317] "GET
> /init/default/search/1/kj?i=0 HTTP/1.1" 200 -
> ERROR    2010-12-26 04:12:58,943 restricted.py:151] Traceback (most recent
> call last):
>   File
> "/media/KRA/Evolve/Work/web2py_src_downloaded/google_appengine/visuallingua/gluon/restricted.py",
> line 188, in restricted
>     exec ccode in environment
>   File
> "/media/KRA/Evolve/Work/web2py_src_downloaded/google_appengine/visuallingua/applications/init/controllers/default.py:download",
> line 242, in <module>
>   File
> "/media/KRA/Evolve/Work/web2py_src_downloaded/google_appengine/visuallingua/gluon/globals.py",
> line 95, in <lambda>
>     self._caller = lambda f: f()
>   File
> "/media/KRA/Evolve/Work/web2py_src_downloaded/google_appengine/visuallingua/applications/init/controllers/default.py:download",
> line 229, in download
>   File
> "/media/KRA/Evolve/Work/web2py_src_downloaded/google_appengine/visuallingua/gluon/globals.py",
> line 197, in download
>     (filename, stream) = field.retrieve(name)
>   File
> "/media/KRA/Evolve/Work/web2py_src_downloaded/google_appengine/visuallingua/gluon/dal.py",
> line 4259, in retrieve
>     return (filename, cStringIO.StringIO(row[self.uploadfield]))
> TypeError: expected read buffer, NoneType found

Reply via email to