SQLFORM(db.recipe) will create a form with all fields used in that database table. But if you want a form with only certain fields then you can use the "fields" argument. For example some of the fields may need to be calculated by you rather than entered manually by the user.
The "Fields" argument is not part of the API so will be ignored. Richard On Oct 23, 1:57 pm, "hamdy.a.farag" <[email protected]> wrote: > Hi, > > supposing I've a function in my controller as follows > > def new_recipe(): > form = SQLFORM(db.recipe, fields= ['title','description']) > return dict(form=form) > > which returns the form to the view where 2 fields are only seen by > user > my question is: > > when I changed 'fields' to 'Fields', I got no complain and I got the > whole form in the view > so what's the point of using 'Fields' any way while I can just say > SQLFORM(db.recipe)? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" 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 -~----------~----~----~----~------~----~------~--~---

