I agree there is a mismatch what is said and what is done. Is your opinion that the manual needs to be revised or that the behavior should be changed (form be prepopulated)?
Massimo On Feb 10, 10:52 am, DenesL <[email protected]> wrote: > Sorry to insist but pre-populate to me means to supply default values > in form fields. > > I know that in web2py we would use > db.tablename.fieldname.default=value > before the form declaration to do that. > > > I believe this is and should be the correct behaviour. > > I agree that the behaviour seems logical but then the manual is > misleading IMHO. > > > form.accepts happens after form.vars.number=5 is set > > From the manual: "Statements like the one above must be inserted after > the form declaration and > before the form is accepted". And that, indeed, is where they have to > be placed. Can not do it before form declaration and does not make > much sense after form accepts. > > > store in form.vars.number whatever is in the form, unless the field > > was not in the form to begin with. > > The manual again: "whether or not the field ("name" in the example) is > explicitly visualized in the form." > > Not visualized and not being in the form are not quite the same thing. > And the "whether" makes it worse, meaning that even if it is > visualized the pre-populated value would take over. > > So, what does pre-populate mean here?. > Currently it is only useful if the field being "pre-populated" is not > returned by the form. > If the field is visualized the "pre-populated" value is not. > > Anybody else has a problem with this wording?. > I am just trying to make things clearer. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

