yes. rationale:
T2 does a lot of stuff for you. db.table.exposes tells T2 which fields you want in forms. If you don't it assumes all fields. Yet you are manually extracting one field from the form object and placing only that one into the HTML form. web2py has no way of knowing that you are displaying only {{=form[0][0][1]}} instead of {{=form}}. You have to tell it that. Massimo On Nov 21, 2:55 pm, "Wes James" <[EMAIL PROTECTED]> wrote: > I'm don't know why that is evil (would you explain?). Anyway, I'm > using that to iterate through all the check boxes (and also place > other components) on the page manually - so I can format their > placement how I want. > > So the exposes will fix the checkbox issue? > > On Fri, Nov 21, 2008 at 1:47 PM, mdipierro <[EMAIL PROTECTED]> wrote: > > > You are doing something evil in page1.html: {{=form[0][0][1]}} > > > Anyway, given your custom forms and I assume you do not want to change > > them. you need to replace > > > @t2.requires_login(next='login') > > def page1(): > > stus=db(db.student.id).select() > > if stus: > > form=t2.update(db.student,db.student.id==1) > > else: > > form=t2.create(db.student) > > return dict(form=form) > > > with > > > @t2.requires_login(next='login') > > def page1(): > > stus=db(db.student.id).select() > > if stus: > > db.student['exposes']=['name','id'] > > form=t2.update(db.student,db.student.id==1) > > else: > > db.student['exposes']=['name'] > > form=t2.create(db.student) > > return dict(form=form) > > > Massimo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---