Hi Offray,
 
I haven't used plugin_wiki, and I'm no routes expert, so I'm sure someone 
else can provide more detailed help, but this should get you started.
 
When you have a plugin_wiki URL like this:
 
http://127.0.0.1:8000/myapp/plugin_wiki/page/test
 
'page' is the function in the 'plugin_wiki' controller, and 'test' is an 
argument in request.args. 'test' does not get passed to 'page' as a function 
argument -- rather, 'test' is available to the 'page' function via the 
global 'request' object (i.e., in request.args). You can see this in the 
plugin_wiki source code: 
http://code.google.com/p/cube2py/source/browse/controllers/plugin_wiki.py#24. 
So, you can't do 'page(test)' as you first tried, since 'page' does not 
accept arguments. Instead, 'page/test' is the right form, but unfortunately, 
default_function only accepts a function and not request arguments, so you 
can't do default_function = 'page/test' either. I think the only way to do 
what you want is probably to use the routes_in/routes_out functionality 
described here: http://web2py.com/book/default/chapter/04#URL-Rewrite.
 
I'm not sure if this is quite right, but maybe something like:
 
routes_in = ( ('/', '/welcome/plugin_wiki/page/test') )
 
Hope that helps.
 
Best,
Anthony
 

On Monday, February 7, 2011 8:10:15 PM UTC-5, Offray Vladimir Luna Cárdenas 
wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1 
>
> Hi again, 
>
> I have an error: 
>
>
> El 07/02/11 19:58, Offray Vladimir Luna C�rdenas escribi�: 
>
>
> [....]
> > --->
> > default_application = 'welcome'    # ordinarily set in base routes.py
> > default_controller = 'plugin_wiki'  # ordinarily set in app-specific
> > routes.py
> > default_function = 'page'   # ordinarily set in app-specific..
> > <---
> > 
> > and it shows the page for pages creation with all the created ones. If I
> > tryed adding parenthesis to "page" function, making it "page()" and it
> > shows a more specif message for page creation. 
>
>
> > When I tried
> > "page(test)", using a previously created "test" page, web2py send me an
> > error message of the form:
> > 
> > invalid function (plugin_wiki/page(test)) 
>
>
> Is not true (bad memory). default_function = 'index', shows the form
> with all the created pages and default_function = 'page' shows the more
> specific message for a page creation. default_function = 'page()' gives
> the same error message that trying with a specific page name. Also when
> I tried default_funtion = 'page/test' for example. 
>
> Thanks, 
>
> Offray
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ 
>
> iQEcBAEBAgAGBQJNUJf3AAoJEGiex2828ICwb5sH/0QvGsdpnhM2JUwJiepTPeLo
> puNNTOyXrhaifpuW21BEBnVVgyEjfEtRo/vJrlF8lDGZ3eacxCr0WoR5lSWpnkcT
> TKYy8lCb2CrW/BuwBHaPsX3qZVjvLGBm7SyxiS0pD+jj4xgBiGqiQmIcabSjs82s
> HBwEkeChbakAmOG2R8W6TW30J0VdVsgfDRiI/zdJ4O48ffT4s1LlhKApPn9VFlt7
> CKhox9it/4aFMMpzmrjEtgyL+Gc4zJmx1KKhTYrRnKniC5TA91jX5HqhUKlFuXHT
> 2OX3mBpkL0rdqoy21aus0/TATDazf32I/Z/yC52/EAgOD4MsF0R+ivd9q6iZ0cg=
> =5CZF
> -----END PGP SIGNATURE-----
>
>   

Reply via email to