How to change default method for calling object from the web?
Hello! I have a problem: Let's assume I have object 'obj' and its method 'view' . So, calling the object 'obj' from web URL (e.g. 'www.mysite.com/path/obj' ) will display content of 'obj'. Calling 'www.mysite.com/path/obj/view' will call method 'view' of the object 'obj'. Now I want that the method 'view' should be DEFAULT method for the object 'obj', so calling 'www.mysite.com/path/obj' should automatically call the method 'view' of object 'obj'. Is it possible to do in Zope and how? -- Regards, Mirsoft
On Wednesday 05 March 2003 13:26, Lubos Culen wrote:
Hello!
I have a problem:
Let's assume I have object 'obj' and its method 'view' . So, calling the object 'obj' from web URL (e.g. 'www.mysite.com/path/obj' ) will display content of 'obj'. Calling 'www.mysite.com/path/obj/view' will call method 'view' of the object 'obj'.
Now I want that the method 'view' should be DEFAULT method for the object 'obj', so calling 'www.mysite.com/path/obj' should automatically call the method 'view' of object 'obj'. Is it possible to do in Zope and how?
Just call your method 'index_html' instead of 'view'. Thierry -- Linux every day, keeps Dr Watson away... http://gpc.sourceforge.net -- http://www.ulthar.net
Thierry FLORAC wrote at 2003-3-5 15:31 +0100:
On Wednesday 05 March 2003 13:26, Lubos Culen wrote: ... Just call your method 'index_html' instead of 'view'.
Or let it acquire "index_html" which calls "view". Dieter
In the class of 'obj' define the method def __browser_default__(self, REQUEST): return self, ('view',) HTH, Stefan --On Mittwoch, 05. März 2003 13:26 +0100 Lubos Culen <mirsoft@gmx.net> wrote:
Hello!
I have a problem:
Let's assume I have object 'obj' and its method 'view' . So, calling the object 'obj' from web URL (e.g. 'www.mysite.com/path/obj' ) will display content of 'obj'. Calling 'www.mysite.com/path/obj/view' will call method 'view' of the object 'obj'.
Now I want that the method 'view' should be DEFAULT method for the object 'obj', so calling 'www.mysite.com/path/obj' should automatically call the method 'view' of object 'obj'. Is it possible to do in Zope and how?
-- Regards, Mirsoft
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
-- Those who write software only for pay should go hurt some other field. /Erik Naggum/
participants (4)
-
Dieter Maurer -
Lubos Culen -
Stefan H. Holek -
Thierry FLORAC