On Monday, July 1, 2013 7:30:51 PM UTC+8, Ray (a.k.a. Iceberg) wrote:
>
> Hi folks,
>
> I just noticed that, the auto patterns generated by dal.py's 
> parse_as_rest() are using hyphen to replace underline. This way if I have:
>
>     db.define_table("my_table",
>         Field("my_field"),
>         )
>
> it will show up in auto patterns as a url like 
> "http://.../my-table/my-field";.
>
> However this brings some inconvenience when I am writing other pieces of 
> program to access this patterns.
>
> So the question is, why dal.py's parse_as_rest() intentionally change all 
> underlines into hyphens? I don't think SEO consideration matters in an api. 
> So why?
>
> Thanks in advance.
>
> Regards,
> Ray
>

Actually I am working on a generic rest api. I end up with several 
unnecessary lines of "...replace('-', '_')", in order to counteract the 
undesirable "underline to hyphen" behavior, came from dal.py's 
parse_as_rest() auto pattern. Yet I am still curious to know, why design a 
"underline to hyphen" behavior in parse_as_rest() auto pattern?

Regards,
Ray

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to