Hi Folks,

After update to 2.5.1 I got this message when I try to update a form with
SQLFORM:
<type 'exceptions.AttributeError'> 'Row' object has no attribute 'bom'

db.define_table('video',
    Field('titulo', requires=IS_NOT_EMPTY(), unique=True),
    Field('tag', 'list:reference tag'),
    Field('slug', requires=[IS_NOT_EMPTY(),IS_NOT_IN_DB(db,
'video.slug'),IS_NOT_IN_DB(db,'tag.nome'),IS_SLUG(maxlen=80, check=True,
error_message='Isso não é um SLUG')], unique=True),
    Field('duracao', requires=IS_NOT_EMPTY()),
    Field('thumb', requires=IS_NOT_EMPTY(), represent = lambda value, row:
XML('<img src='+value+'></img>')),
    Field('bom', 'integer', default=1, writable=False, readable=False),
    Field('ruim', 'integer', default=1, writable=False, readable=False),
    Field('true_views', 'integer', default=0, writable=False,
readable=False),
    Field('postar_em', 'datetime', default=request.now),
    Field.Virtual('qualidade', lambda row: "%.0f"
%(float(row.video.bom)/(row.video.bom+row.video.ruim)*100)),
    Field('ativo', 'boolean', default=True,),
    )

 Function argument list

(row=<Row {'video': {'slug': 'video-slug', 'id': 97L}}>)

But using video.qualidade on views works... it raises the exception during
form edit...

video=db.video(video_id)
form=SQLFORM(db.video,video,submit_button='Salvar')

-- 

Linux User #387870
.........____
.... _/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:_______

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to