durusmail: quixote-users: map class to root namespace
map class to root namespace
map class to root namespace
Ksenia Marasanova
2004-02-23
Got it! Passing class instance to Publisher did what I wanted. RTFM.
Sorry for bothering.

...
from ksenia import Website
app = Publisher(Website())
...

Life is beautiful :)
Ksenia.


> Hi list,
>
> It must be a very silly newbie question, but I'm stuck, sorry. I want
> to map a class to the root namespace of the website. So when / is
> requested I want  class Website to take care of processing.
>
> What I did:
> ----------------
> In /cgi-bin/index.cgi
> ...
> app = Publisher("ksenia")
> ...
> (initialization stuff)
> ...
>
> In ksenia/__init__.py:
>
> _q_exports = []
> def _q_index():
>       return Website()
>
> class Website:
>       def _q_index(self, request):
>               return "Hello, world"
> -----------------
>
> Instead of "Hello, world" I get 
>
> What am I doing wrong?
>
> Thanks in advance.
> Ksenia.
>
>
> _______________________________________________
> Quixote-users mailing list
> Quixote-users@mems-exchange.org
> http://mail.mems-exchange.org/mailman/listinfo/quixote-users
>



reply