I'm hitting a brick wall when trying to convert my table (under PostgreSQL) 
to use "blob" storage.  The problem seems to be that web2py doesn't 
properly recognize and initialize the blob field.  For example, when I 
tried this:

            db.define_table("fileobject",
                Field("upload_data","blob"),
                Field("upload","upload",uploadfield='upload_data'),
                ...

The code fails when uploading the blob.  In the DAL, in the code for 
Field.store():


        self_uploadfield = self.uploadfield
        if isinstance(self_uploadfield,Field):
            blob_uploadfield_name = self_uploadfield.uploadfield
            keys={self_uploadfield.name: newfilename,
                  blob_uploadfield_name: file.read()}
            self_uploadfield.table.insert(**keys)
            ...
 

In this case, the test to see if self_uploadfield is a Field FAILS -- 
because the uploadfield still has the string "upload_data", not the 
corresponding Field.

Next, I thought I'd try the old-school way, I put the Field definition as 
the argument to uploadfield:


            db.define_table("fileobject",
                
Field("upload","upload",uploadfield=Field("upload_data","blob")),
                ...


Again, this FAILS, but for a different reason -- the "table" attribute of 
the "upload_data" table never got initialized to "fileobject"!

I just can't find a way around this.  I'm using web2py version 2.5.1-stable 
under OSX (running from source).

-- Joe B.

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to