template inheritance

Alex K spaceoutlet at gmail.com
Sun Jan 11 18:32:04 CET 2009


While building a website using template inheritance one usually does
the following:

fetch from database
fetch from some more data from database
... << more required computations
then at the end render the template with the fetched data

Without template inheritance one usually does the following:

fetch from database
render this part of the site with this fetched data
fetch some more data from the database
render this other part of the site with the fetched data
...
etc

The first approach is much more elegant and leads to easier to
maintain code. However the user will have to wait till the end of the
fetching (long computations) before any rendering can take place. In
the second approach however the site loads as we are fetching the data
which is more convenient to the user.

Am I correct to assume this? Is there a way to get the best of both
worlds? Thank you.



More information about the Python-list mailing list