[Zope-CMF] Five views / redirects

pete computer-project at hotmail.co.uk
Mon Oct 17 15:14:11 EDT 2005


Sorry in advance if this is a dumbo question, but I'm having trouble 
seeing the style to follow in the following situation:

  - user calls a url, say /object/tuesday_message

  - if today's date is a tuesday, render 'tuesday.pt'

  - otherwise render 'no_message.pt'

both tuesday.pt and no_message.pt are proper templates which need to 
follow the site's main template, and have some logic in a view class.

Without views, I would make tuesday_message a python script, and return 
the required template directly with context.tuesday() or 
context.no_message().

But what's the best way to do this with a view: I don't want users to be 
able to access the templates directly, so I can't redirect between them, 
  and the two templates are sufficiently different not to be combined 
together in an if-else type way.

TIA

pete



More information about the Zope-CMF mailing list