[Zope] - RE: Zope programming idioms

Jeff Bauer jeffbauer@bigfoot.com
Thu, 17 Dec 1998 18:59:50 -0600


  >> This doesn't feel right, however [snip] but there must 
  >> be a more natural way to:
  >>
  >>    dtml -> object method -> dtml -> whatever

  > Hmm, it looks alright to me, I'm not sure what the 
  > problem it.
  >
  > Maybe it the '-> whatever' bit. I don't understand that 
  > part of the flow.

By 'whatever' I meant that it might return a document
or invoke another object method that returns a document 
or invokes another object method or ... whatever.

  > In general I write methods that should be accessed from
  > the web the same way as you do:

Then I must be doing something right <wink>.

  > def spice(self,salt,pepper,REQUEST=None):
  >  "spice the meal"
  >  ...
  >  if REQUEST is not None:
  >    return self.some_dtml_class_attribute(self,REQUEST,
  >      message="meal successfully spiced")
  >
  > If there is no need to specifically confirm the spicing 
  > operation, you could return a different method, like 
  > index_html, the PARENT's index_html, or manage_main, etc. 
  > depending on context.

Okay, just getting independent confirmation that I'm 
not totally off-base helps.  Or at least I'm in good 
company.

At any rate, the round-trip nature of dtml to object
methods to dtml to whatever probably makes useful
how-to fodder.  How will the proposed JimF changes
to DocumentTemplate affect this idiom?

Best regards (and thanks)

Jeff Bauer
Rubicon, Inc.