I think Massimo already give clear answer in his post.

And I try to give my $0.02 on this from another aspect. Let's say you
create form in your view rather than controller, don't you still need
to somehow describe this form in the controller again, in order to
make your controller capable to "understand" the form data sent from
browser? If so, how would you describe its data structure, in your
controller? There are 2 conventions in web2py to do that, one is the
example #28 Ryan mentioned, the other is SQLFORM.factory(Field(...),
Field(...)) Massimo mentioned. It just happened that the "description"
in controller, has a default appearance even without a view, which
could make MVC-believer confused. Hope my explanation make some sense.

By the way, I remember there was a deep discussion on this MVC topic
in this mail list, but I just did not dig it out, yet.

Regards,
Iceberg

On Sep13, 0:26am, Ryan Montgomery <[email protected]> wrote:
> Thanks for the response. I guess my question was more about why it's
> even possible with a web framework that is said to be designed for
> best practices, and more so, uses it in the only forms example in the
> documentation.
>
> I'm new to web2py so I am trying to understand the "right" ways to do
> things, but this was a red flag that I figured had to have some
> explanation.
>
> Ryan
>
> On Sep 11, 12:54 am, mdipierro <[email protected]> wrote:
>
>
>
> > Yes. The fact that you can do it, does not man you should do it.
>
> > Sometime need to build HTML programmatically, for this reason web2py
> > provides a OOP server side representation of the DOM so that you never
> > have to manipulate strings in the controllers.
>
> > You can use this to build forms but you do not have to.
>
> > Often it is better to use
>
> > form=SQLFORM.factory(Field(...), Field(...), Field(...))
>
> > and then customize the form in the view.
>
> > Massimo
>
> > On Sep 10, 8:13 pm, Ryan Montgomery <[email protected]> wrote:
>
> > > I am new to web2py and I have some questions. The first one being:
>
> > > Does the ability to creating Forms with html tables in the controller
> > > violate the principal of "Separationof Concerns"? Shouldn't this
> > > "view logic" be handled in the view and not in the controller?
>
> > > Please reference example 
> > > #28http://www.web2py.com/examples/default/examples#form_examples
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to