[web2py] Re: URL Helper and application root

2013-02-28 Thread RHC
If I use {{=URL(request.application)}} in the view I get /Test/default/Test It has added on the current application and controller path. I would like to get just /Test/ or, if I have used routes.py to set the default application to Test, maybe just /. This is why I am trying to use the URL

[web2py] Re: URL Helper and application root

2013-02-28 Thread Niphlod
I'm *not *sure but I think routes just changes on the fly the various request.* pieces, so - again, *not *sure - using '/' + request.application + '/' should work ok. On Thursday, February 28, 2013 5:30:53 PM UTC+1, RHC wrote: If I use {{=URL(request.application)}} in the view I get

[web2py] Re: URL Helper and application root

2013-02-28 Thread Anthony
No, just do: {{='/%s/' % request.application}} Anthony On Thursday, February 28, 2013 11:30:53 AM UTC-5, RHC wrote: If I use {{=URL(request.application)}} in the view I get /Test/default/Test It has added on the current application and controller path. I would like to get just /Test/

[web2py] Re: URL Helper and application root

2013-02-28 Thread RHC
Niphlod, Antony: Thanks for your prompt replies. I can see that request.application will function correctly as web2py will still handle a URL beginning with the application name even if I have used routes.py to default to this application, Doing it this way does mean that I would end up with

[web2py] Re: URL Helper and application root

2013-02-28 Thread Anthony
{{='/%s/' % request.application if URL().startswith('/' + request. application) else '/'}} Anthony On Thursday, February 28, 2013 12:26:32 PM UTC-5, RHC wrote: Niphlod, Antony: Thanks for your prompt replies. I can see that request.application will function correctly as web2py will still

[web2py] Re: URL Helper and application root

2013-02-28 Thread RHC
Ah, that looks like it would do what I need. Thanks! On Thursday, February 28, 2013 7:43:35 PM UTC, Anthony wrote: {{='/%s/' % request.application if URL().startswith('/' + request. application) else '/'}} Anthony On Thursday, February 28, 2013 12:26:32 PM UTC-5, RHC wrote: Niphlod,

[web2py] Re: URL Helper and application root

2013-02-27 Thread Niphlod
ehm ... request.application ! On Wednesday, February 27, 2013 10:26:51 PM UTC+1, RHC wrote: I'm trying to use javascript to automatically insert a link to a plugin web page within an application. However, the javascript, being a static file, has no way of generating a valid URL in the

[web2py] Re: URL Helper.

2012-01-12 Thread Anthony
What's your use case? On Thursday, January 12, 2012 10:11:14 AM UTC-5, David J wrote: I think it would be a worthwhile feature to be able to get information from a URL helper object. For example, If we create a tuple of URL objects, and we want to loop through them, we may want to be

Re: [web2py] Re: URL Helper.

2012-01-12 Thread David
Right now I am using it for response.menu But I want to be able to do some sort of grouping based on either controller or function. so I store all my urls in as in the /models/menu.py then I do things like check if the user is logged in and add more to that menu; Now I want to do some

Re: [web2py] Re: URL Helper.

2012-01-12 Thread David
I could also imagine; I may want to do this at some point. URL().args.append('arg3') On 1/12/12 10:20 AM, Anthony wrote: What's your use case? On Thursday, January 12, 2012 10:11:14 AM UTC-5, David J wrote: I think it would be a worthwhile feature to be able to get information

[web2py] Re: URL Helper.

2012-01-12 Thread Massimo Di Pierro
We did this once and had to revert because it broke backward compatibility. I guess we can try again but the object must derive type string. On Jan 12, 10:43 am, Jonathan Lundell jlund...@pobox.com wrote: On Jan 12, 2012, at 8:33 AM, Anthony wrote: On Thursday, January 12, 2012

Re: [web2py] Re: URL Helper.

2012-01-12 Thread Jonathan Lundell
On Jan 12, 2012, at 12:22 PM, Massimo Di Pierro wrote: We did this once and had to revert because it broke backward compatibility. I guess we can try again but the object must derive type string. Yeah, or its own class. URI, perhaps.

Re: [web2py] Re: URL Helper.

2012-01-12 Thread Bruno Rocha
Or can just create a new helper URLBuilder -- Bruno Rocha [http://rochacbruno.com.br]

[web2py] Re: URL helper - using register and next

2011-11-30 Thread lyn2py
And how did I miss that?? Thanks Bruno! Funny behavior?: * I used next and it worked for the login link. * if I used auth.login(_next=...) and an error tells me I can't use _next (I have to use next) - but I didn't try what works with auth.register(_next or next?) On Nov 30, 10:52 pm, Bruno

[web2py] Re: URL helper - using register and next

2011-11-30 Thread Anthony
On Wednesday, November 30, 2011 10:00:05 AM UTC-5, lyn2py wrote: And how did I miss that?? Thanks Bruno! Funny behavior?: * I used next and it worked for the login link. Are you sure the 'next' value for login isn't being set somewhere else (or isn't simply the default 'index')? Using

[web2py] Re: URL helper - using register and next

2011-11-30 Thread lyn2py
Hi Anthony, Thanks for the clarification. Regarding: Are you sure the 'next' value for login isn't being set somewhere else (or isn't simply the default 'index')? Using 'next' (rather than '_next') in the URL should not work. I'm new to this, and I am not sure if the 'next' value isn't being

[web2py] Re: {{=URL(...)}} helper in javascript function

2011-09-30 Thread Massimo Di Pierro
This line Delete: {{=URL('controller_name', args=[a,b,..])}} should be Delete: {{=URL('controller_name', args=[a,b,..])}} otherwise this fine. Make sure you do not have any {{ in the JS other than for web2py takes. If you do break them with a space. On Sep 30, 11:36 am, Vineet