Michael Long wrote:
Thank you for you thorough critic of this method. I like zpt, the idea of having presentation logic in template and business logic in a script makes a lot of sense to me. However, I am only now begining to get my head around python and the zopish way of doing things. Please clarify your comments below.
Well, if you're just starting, learns ZPT now, not DTML...
setattr(myClass, 'Content_Main', Content_Main)
eep!
Why eep!?
You're setting the attribute of a _class_ in a method. Go ask on comp.lang.python why that's bad, but, the quick answer is just DON'T DO IT!
if REQUEST is not None: return self.Template_index_html(self, REQUEST)
Where does Template_index_html come from?
It is defined in a module which is then imported into each module that needs it. Is there an issue I should be aware of?
Urm, I don't think you've given the whole story there. How does it end up in self?
I am simulating the back button in the browser. I am using the following solution to make it happen. <input type="button" value="Back" onclick="history.go(-1)">
Yup, so why the code? The above is a much better way to do it, although 'back' as a concept is very simple (hence why everyone loves it), the implementation is often very complex... think about form submission, and one-way state transitions... Chris