On Fri, Jun 3, 2011 at 1:17 PM, GoldenTiger <goldenboy...@....> wrote:

> Very good security upgrade
>
> About conditional models, what are they exactly?
>


user requests http://127.0.0.1:8000/app and all python files under
app/models folder will be executed, this is not always necessary, because
not all your controllers will need to use objects defined in all models, so
you end up with more objects in memory than you really need.

*Now with conditional models:*

request http://127.0.0.1:8000/app/default/<anything> -> all models under
app/models folders will be executed. also all files under app/models/default

request http://127.0.0.1:8000/app/anothercontroller/<anything> -> all models
under app/models folders will be executed. also all files under
app/models/anothercontroller

request http://127.0.0.1:8000/app/default/home.html -> all models under
app/models + all models under app/models/default + all models under
app/models/default/home

Practically your simple contact page no need to load all models to simply
shows a contact form.

requesting: http://127.0.0.1:8000/app/default/contact will execute all
models under app/models (try to let just global access objects defined
there), also all models under app/models/default (only default.py controller
commom objects) and also all models in app/default/contact (specific objects
for contact page, i.e: define the contact_table, load lists to populate
dropboxes, maps etc..)

I hope it explains how it works.

Bruno Rocha
http://blouweb.com
http://CursoDePython.com.br

Reply via email to