handling parameters with TG2.2 - values truncated after dot...

36 views
Skip to first unread message

Remi Jolin

unread,
Sep 12, 2012, 11:55:15 AM9/12/12
to turbo...@googlegroups.com
Hello,

Coming from TG1 I started playing with TG2.2 a few days ago and I
encountered this :

Suppose you have a controller with
def fct(self, a, b=None):
# do something
return something

http://localhost:8080/fct/abcdef
gives a = 'abcdef', b=None. That's OK

but
http://localhost:8080/fct/abc.def
gives a = 'abc', b=None !! NOT OK

and
http://localhost:8080/fct/abc.def/123
a='abc.def', b='123' - OK

and
http://localhost:8080/fct?a=abc.def
a='abc.def', b=None - OK

Any explanation ?
Is it the expected behavior ?

Alessandro Molina

unread,
Sep 14, 2012, 7:22:03 PM9/14/12
to turbo...@googlegroups.com
It is the default expected behavior, if the url ends with .ext it is
considered being the webpage extension and used to choose which
@expose decorator consider in case of multiple templates exposed. It
is useful if you want to expose the controller for example both for
html and json, calling page.json will return the json version while
calling .html (or no extenion at all) will return the html page.

You can change this by setting disable_request_extensions to false
inside app_cfg.py
> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To post to this group, send email to turbo...@googlegroups.com.
> To unsubscribe from this group, send email to
> turbogears+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/turbogears?hl=en.
>

ozwyzard

unread,
Oct 10, 2012, 5:45:55 PM10/10/12
to turbo...@googlegroups.com
You may find more information about special characters in a URI here:

http://tools.ietf.org/html/rfc3986
Reply all
Reply to author
Forward
0 new messages