silent processing with python+modpython+cheetah

S

Sai Krishna M

Hi,

I have been working for some time developing web pages using python,
modpython, cheetah.
I find that this method has come inherent difficulties in it like if
we want to generate a single page we have to write two separate files
( py & tmpl).
Is there any other better way of doing things.?

Also if we want to have partial processing of the pages, i.e, the
value one chooses for a particular field determines the value to be
entered for another field in the same page, how can it be done?

Thanks,
Sai krishna.
 
B

Bruno Desthuilliers

Sai Krishna M a écrit :
Hi,

I have been working for some time developing web pages using python,
modpython, cheetah.
I find that this method has come inherent difficulties in it like if
we want to generate a single page we have to write two separate files
( py & tmpl).
Is there any other better way of doing things.?

If you need to write specific python module and template for each and
any page of your site/app, it may be time to google for "content
management system" and "model view controller".
Also if we want to have partial processing of the pages, i.e, the
value one chooses for a particular field determines the value to be
entered for another field in the same page, how can it be done?

Stop thinking in terms of "page", and you'll be on the way. Or switch to
Pylons:
http://www.pylonshq.com
 
G

grahamd

Sai said:
Hi,

I have been working for some time developing web pages using python,
modpython, cheetah.
I find that this method has come inherent difficulties in it like if
we want to generate a single page we have to write two separate files
( py & tmpl).
Is there any other better way of doing things.?

It sounds like you are actually using mod_python.publisher and hand
crafting the code to render the template file in each instance. Using
mod_python.publisher is not the same as using basic mod_python handlers
directly. If you were using basic mod_python handlers directly, you
certainly could write your own dispatcher which encapsulates in one
place the code needed to render a Cheetah template file, thereby
avoiding the need to create .py file corresponding to every Cheetah
template file.
Also if we want to have partial processing of the pages, i.e, the
value one chooses for a particular field determines the value to be
entered for another field in the same page, how can it be done?

That sounds like an internal issue of how you use Cheetah templates
itself. Cheetah templates have flow control abilities, blocks etc such
that one can control what parts of a page are actually used.

Since mod_python inherently means you start out working at a low level,
and that you don't perhaps fully appreciate the different levels of
functionality in mod_python and how to use them, you are possibly
better off using a high level framework such as Django or TurboGears
where someone else has done all the hard work of making it simple to
use.

Graham
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top