Web2py uses the controller:view like any MVC. But don't think of the
view as a whole page. Think of it as a view component for your applet.
The link to the controller is not that limiting. If all you need is
just a view just add a "def mycode(): return". No code. Move your
focus to the controller and you will be ok.

Since Web2py includes jQuery, ajax calls are fairly simple. I modify
layout.html to how I want it for presentation. Use {{include}} for
nondynamic content. Where I want applets I define appropriate Divs. An
initial setup of $(document).onready() making a call to the controller
(s) to load the content.

On May 6, 5:15 am, Joe  Barnhart <joe.barnh...@gmail.com> wrote:
> I've been pondering the best way to create sites with rich pages that
> contain lots of "applets" or "tasklets".  It seems limiting to have
> the entire page tied to a single Python function.  Maintaining the
> site could be problematic if everything funnels through one
> "controller" function.
>
> Then I wondered about the structure of the layout files.  I like the
> "extend" and "include" functionality.  I imagine I could create a tree
> of html files --- one for each applet div, for example, with
> layout.html at the root.  Perhaps a "news" area and a "calandar" area
> in addition to the main body, for example.
>
> Each functional block could be represented by a file such as
> "news.html" and "calandar.html" included into layout.html.  The
> controller for each would then extend its own html file instead of the
> top-level "layout.html" file.
>
> Is there a still better way to organize a busy site?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to