durusmail: quixote-users: PTL and overall site structure
PTL and overall site structure
2004-10-12
2004-10-12
2004-10-12
PTL and overall site structure
Paul Moore
2004-10-12
On Tue, 12 Oct 2004 16:29:29 +0200, Jkx  wrote:
> This really sound as Webware use SitePage :) ..

That's probably where I got the idea from :-)

> I get into the same trouble when i first come to Quixote. The simplest
> way is to
>
> __q_exports = []
>
> def __q_index(req):
>      return Page(req)

Hmm, right. I think I follow this. The _q_index function is the
"default" namespace at this point in URL mapping. By returning a class
(which is another namespace) I go down one level of namespace without
consuming a component of the URL.

Actually, I think I'll get confused if I think too hard about it - it
just works...

> and simply add the __call__ (or _q_index) in your SitePage class that
> do the defaut behaviour.
>
> class SitePage:
>      def __q_index(self,req):
>   self.head(req)
>   self.content(req) ...
>          self.footer(req)

That looks good. I'll think about it a little more (I get the feeling
that I'm adding a function wrapper round each class) but I get the
general picture.

Thanks for the help,
Paul

reply