silent processing with python+modpython+cheetah

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sai Krishna M

    #1

    silent processing with python+modpython+cheetah

    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.
  • Bruno Desthuilliers

    #2
    Re: silent processing with python+modpytho n+cheetah

    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:

    Comment

    • grahamd@dscpl.com.au

      #3
      Re: silent processing with python+modpytho n+cheetah


      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.publ isher and hand
      crafting the code to render the template file in each instance. Using
      mod_python.publ isher 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

      Comment

      Working...