I cannot get this right... one more try:
db.define_table('person',db.Field('name'),db.Field('secret'))
db.person.secret.writable=False ### NEW
db.person.secret.readable=False ### NEW
db.person.name.label='Name'
db.person.name.comment='(your full name)' ### NEW
db.person.name.represent=lambda value: H2(value) ### NEW
db.person.insert(name='Max')
def index():
person=db(db.shape.id>0).select()[0]
form1=SQLFORM(db.person,person)
def f(form): form.vars.secret='xxx' ### NEW
if form1.accepts(request.vars,onvalidation=f):
response.flash='done!'
form2=SQLFORM(db.person,person,readonly=True) ### NEW
persons=db(db.person.id>0).select(db.person.name,db.person.secret)
return dict(form1=form1,form2=form2,persons=persons)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---