Thank you Tim, I already used your method in some tests and it's
fine.
I was just asking if among that mass of "custom forms" posts there was
something new and "standard" in the web2py sense.
I am really wondering if we want to promote this kind of coding as the
"web2py way":
form=FORM(TABLE(TR("Author:",INPUT
(_type="text",_name="author",requires=IS_NOT_EMPTY())),
TR("Comment:",TEXTAREA
(_type="text",_name="body",_rows="10",_cols="40",requires=IS_NOT_EMPTY
())),
TR(INPUT(_type="hidden",_name="book_id",_value=request.vars.bid)),
TR("",INPUT(_type="submit",_value="Submit"))))
and this is just the smallest example you can find in the web2py free
appliances.
And I can not even post my 20 line forms I have in a controller of one
of my first web2py app.
>From my past experience I am a little scared about building my next
form intensive app based on such examples.
carlo
On 17 Feb, 15:18, Timothy Farrell <[email protected]> wrote:
> What you're asking about is very close to "The Tim Farrell way" Maybe
> you should take a closer look at it. The only differences I see are:
>
> - I didn't use helpers with my template code (but you are free to)
> - Validation facilities are limited to one form per page with a few
> applications
>
> =)
>
>
>
> carlo wrote:
> > I wanted to make the point on one of my favourite subjects, forms
> > designed in the best MVC pattern possible, so I browsed the forum
> > searching for the latest achievements to this respect. I found
> > different solutions but they looked a bit more like extemporaneous
> > tricks than a reference "how to". I found to different degrees: Bill's
> > Patch, DenesL custom forms, rfx_labs custom forms (where you can find
> > the underdocumented "form.element" syntax) and forms "the Tim Farrel"
> > way.
>
> > I can not understand why in the documents/tutorial/examples forms are
> > always designed in a usual "everything in the controller" pattern:
> > saying "always" maybe I am exaggerating a little, but this is the
> > trend. I find this a bit uneducating because it brings to coding
> > controllers just the worst php manner. I would prefer there was a
> > "suggested" web2py way used throughout every example.
>
> > My "good " forms, at least:
> > - data queries in controller or model
> > - define a "form" object in controller is acceptable
> > - helpers and/or html in views
> > - validation facilities must be preserved
> > - forms auto submitting must be preserved
>
> > May I ask someone to summerize, as 1.56.3 version is out, the best/
> > suggested way to design forms following an MVC pattern as clean as
> > possibile? Thank you
>
> > carlo
>
> --
> Timothy Farrell <[email protected]>
> Computer Guy
> Statewide General Insurance Agency (www.swgen.com)
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---