Question: how to call HiddenField outside of define_table, as in the controller? I find that usually, when I hide field, it's because I'm uniting 2 tables in 1 form and I want to selectively populate fields in each table, but ultimately, all fields in the tables will be populated via forms. So I am hiding fields in my controllers, not my models.
On Sep 17, 1:12 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > ERRATA^3 > > I like to define > > def HiddenField(*a,**b): > b['writable']=b['readable']=False > return Field(*a,**b) > > and use > > db.define_table('mytable',Field('name'),HiddenField('manager')) > > On Sep 17, 11:53 am, Fabio Alessandro Locati <floc...@grimp.eu> wrote: > > > > > thank you guys, it works perfectly :) > > > 2010/9/17 Jonathan Lundell <jlund...@pobox.com> > > > > On Sep 17, 2010, at 6:25 AM, mdipierro wrote: > > > > > ERRATA: > > > > > I like to define > > > > > def HiddenField(*a,**b): > > > > a['writable']=b['readable']=False > > > > return Field(*a,**b) > > > > I *think* you mean: > > > > b['writable']=b['readable']=False > > > > > and use > > > > > db.defiend_table('mytable',Field('name'),HiddenField('manager')) > > > > and db.define_table(... > > > > > On Sep 17, 8:22 am, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > >> I like to define > > > > >> def HiddenField(*a,**b): > > > >> a['writable']=b['readable']=False > > > > >> and use > > > > >> db.defiend_table('mytable',Field('name'),HiddenField('manager')) > > > > >> On Sep 17, 6:07 am, "Martin.Mulone" <mulone.mar...@gmail.com> wrote: > > > > >>> To hide a field: > > > >>> Field('out','boolean',writable=False,readable=False) > > > > >>> And computed fields in book: > > >http://web2py.com/book/default/chapter/06#Computed-Fields > > > > >>> On 17 sep, 05:58, Fabio Alessandro Locati <floc...@grimp.eu> wrote: > > > > >>>> Hi, > > > >>>> I'm trying to make a form with a hidden field, but I haven't found > > > >>>> the > > > way > > > >>>> to do it :(. > > > > >>>> I have a table: > > > >>>> db.define_table('partners', > > > >>>> Field('name','string'), > > > >>>> Field('out','boolean')) > > > > >>>> I want to ask to the user the name of the partner and, based on the > > > name of > > > >>>> the page, the value of 'out'. I was thinking into making two > > > >>>> different > > > pages > > > >>>> one that has - at code level - out=1 and the other one that had > > > >>>> out=0. > > > How > > > >>>> can I do this, without showing to the user the existence of the 'out' > > > field? > > > > >>>> Thanks :)- Hide quoted text - > > - Show quoted text -