T3
Beyond MVC
Login | Register | Password

Readme


Many modern web frameworks follow a Model-View-Controller design. But if you think about it, every web application is very much like a wiki that comprises of pages, a way to navigate those pages and components embedded in those pages.
A component is an atomic element, like a CRUD for, which determines its state from the HTTP request, the sessions, the cache and the database, but it does not interact much with other components in the same page. Components have a state, can transfer control to another page, process user input and database output. The idea was to give each of those components a life of its own, i.e. its own Model-View-Controller structure.

Plugin T2 is a collection of components that web2py users can embed in their applications. T2 components are modular, easy to use, customizable and work on Google App Engine. By following the T2 examples it is possible to create additional components.
Plugin T2 can be installed as any other web2py application except that one should not change its name "plugin_t2" and import it as explained in the documentation. The plugin includes a Python module (t2.py) but it is not itself a module because its functions require static files, scripts, services, etc. that belong to an application, not a Python module. Every app that uses plugin T2, creates its own instance of the T2 class and the T2 components act of the global variables (request, response, session, cache, T, db) of each specific application.

T3 is not a plugin. It is an app, but an app that requires plugin T2. It is a wiki but it also allows you to embed Python code in pages. In particular it allows you to include T2 components. The template language is NOT the same as the web2py template language used to build T2. T3 is designed exclusively to post components in pages.

While to use T2 in web2py you need to edit the web2py scaffolding application., to use T3 you do not need to create a web2py application. You install T2 and T3. You rename T3 as you like, you upload it on the Google App Engine (or you favorite hosting provider) and then simply edit the wiki pages generated by T3. You do not change T3, you use T3. All data is stored in the database, including the code you write within T3.

At this point T3 is a proof of concept. It is functional but we are still testing some of the functionalities. We are planning to add three main features: A designer to design database models without coding, a designer to customize the page layouts/colors, the option to hide error in production mode.

T3 is not a replacement for web2py because it is less flexible than web2py is. Nevertheless we think of it as useful app that drastically reduce the development time of web applications.
T3 excluding HTML, static files and JS amounts to less than 100 lines of web2py code.

Available T2 components

self.action(...)
self.redirect(...)
self._error(...)
self.create(...)
self.update(...)
self.delete(...)
self.read(...)
self.display(...)
self.itemize(...)
self.search(...)
self.wiki_nav(...)
self.wiki_menu(...)
self.wiki(...)
self.comments(...)
self.profile(...)
self.reset_password(...)
self.login(...)
self.verify(...)
self.logout(...)
self.requires_login(...)
self.add_membership(...)
self.del_membership(...)
self.have_membership(...)
self.my_memberships(...)
self.add_access(...)
self.del_access(...)
self.have_access(...)
self.email(...)
self.rating_widget(...)
self.tag_widget(...)
self.clear_cart(...)
self.add_to_cart(...)
self.checkout_cart(...)
self.urlopen(...)
self.coords_by_address(...)
self.barchart(...)

Available objects

All Python commands (but DO NOT USE PRINT!)
All Python modules but need to be imported
response
session
cache (example: cache.ram('key',function,t))
db (example: db.define_table(...))
all web2py helpers