By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,442 Members | 1,580 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,442 IT Pros & Developers. It's quick & easy.

silent processing with python+modpython+cheetah

P: n/a
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.
Oct 21 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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
Oct 21 '06 #2

P: n/a

Sai Krishna M wrote:
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

Oct 22 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.