Problem with URL inside loaded component - Bug??

34 views
Skip to first unread message

Jim S

unread,
Mar 14, 2013, 4:11:42 PM3/14/13
to web...@googlegroups.com
I have a LOADed component and in the controller I'm doing the following to turn my id into a link.

db.productSite.siteId.represent = lambda x,r:A('%s-%s' % (db.site(x).site,db.site(x).name),_href=URL('applications','productSites',args=('edit',r.productSiteId)))

The problem is when I try to click on the link, it inserts a .load into the URL.

Here is what it is generating:


Is there something obvious I'm overlooking or is this possibly a bug?

-Jim

LightDot

unread,
Mar 14, 2013, 4:34:30 PM3/14/13
to web...@googlegroups.com
I don't think it's a bug, .load is inherited in this case, isn't it? In other words, it's a feature :)

You can set extension=False in the URL(), that prevents .load from getting added.

Regards,
Ales

Jim Steil

unread,
Mar 15, 2013, 9:12:01 AM3/15/13
to web...@googlegroups.com
That did the trick.  I didn't know about that argument.  Thanks for the heads up.

-Jim


--
 
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/aWpQ0F3g8aY/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Anthony

unread,
Mar 15, 2013, 9:23:26 AM3/15/13
to web...@googlegroups.com
From the book:

By default, the extension corresponding to the current request (which can be found in request.extension) is appended to the function, unless request.extension is html, the default. This can be overridden by explicitly including an extension as part of the function name URL(f='name.ext')or with the extension argument:

URL(..., extension='css')

The current extension can be explicitly suppressed:

URL(..., extension=False)
Reply all
Reply to author
Forward
0 new messages