Hi all, I've just discovered that the fields defined as computed in the 
'upper table' are not executed in the table that inherits the fields.
The following is the definition of the upper table
pictures_fields = db.Table(db, 'picture',
    Field("picture", "upload", 
uploadfolder=request.folder+'uploads/pictures', uploadseparate=True, 
autodelete=True, requires=[IS_NOT_EMPTY(), IS_IMAGE(), 
IS_UPLOAD_FILENAME(extension='jpg|jpeg|png'),IS_IMAGE(extensions=('jpeg', 
'png'))]),
    Field("normal", "upload", 
uploadfolder=request.folder+'uploads/pictures', uploadseparate=True, 
autodelete=True, requires=[IS_IMAGE()]),
    Field("thumbnail", "upload", 
uploadfolder=request.folder+'uploads/pictures', uploadseparate=True, 
autodelete=True,  requires=[IS_IMAGE()]),
    Field('picture_desc', 'text', requires=[IS_TRIM(), 
IS_LENGTH(140,error_message=T('Warning, description too long'))]),
)
pictures_fields.thumbnail.compute = lambda row: THUMBER(row.picture, 200, 
200, name='thumb') 
pictures_fields.normal.compute = lambda row: THUMBER(row.picture, 600, 600, 
name='normal') 
pictures_fields.picture_desc.label = T('Picture description')

What is wrong?

Regards,
paolo

-- 



Reply via email to