web2py gives quite some latitude with regard to doing things... I
understand there are major no-nos, but is there a best way ? We had
that discussion of putting common stuff in models, I'm not that sure
about the helpers only in views either (I use them in controllers,
when there is a reason - FORMs are a good example). MVC is (very) good
practice, but I don't think it should be so blindly adhered to it that
it becomes the only criteria of code quality (especially as the MVC
pattern doesn't completely fit web development).

On Feb 17, 9:01 pm, DenesL <[email protected]> wrote:
> On Feb 17, 6:03 am, carlo <[email protected]> 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 guess I missed some of those.
> Did you make a note of which posts are they on?.
> I would like to read them without having to search, which brings us to
> the next point...
>
>
>
> > 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.
>
> Many new features (good) documented in posts and/or alterego and/or
> you-name-it (bad).
> We need to centralize & update the docs too.
>
>
>
> > My "good " forms, at least:
>
> I think the custom objects in SQLFORM pass the test:
>
> > - data queries in controller or model
>
> and using keepopts saves you another DB query
>
> > - define a "form" object in controller is acceptable
>
> this is a must
>
> > - helpers and/or html in views
>
> check
>
> > - validation facilities must be preserved
>
> just remember to name your elements
>
> > - forms auto submitting must be preserved
>
> use <form action="" ...>
>
> > 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
>
> After reading the different "ways" we might get together and work
> something out.
> Tim? Bill? Carlo...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to