On Jul 12, 9:09 am, BrianTheLion <[email protected]> wrote: > I have created a function, myurl, that I use as a replacement for > pylons.url with the goal of giving fully-qualified URLs by default. I > implement this functionality by applying the keyword argument > "qualified=True" to everything. E.g., > > def myurl(*args,**dargs) : > dargs['qualified']=True > return url(*args,**dargs) > > Now, per the documentation, I have a static route to an external > website declared as follows: > > map.connect('create_facebook_page', 'http://www.facebook.com/pages/ > create.php', _static=True) > > When I call myurl('create_facebook_page') - hence, > url( 'create_facebook_page',qualified=True) - I get the nonsensical > result "http://myhost//www.facebook.com/pages/create.php". > > To me, this does not seem like the most desirable behavior. Ideally, > pylons.url would be "smart" enough to know that routes to external > sites do not need further qualification, and would simply ignore the > qualified=True option. As a second-best, it would throw an error. > > Does anyone want to chime in before I file a ticket? I am on v0.9.7. > Perhaps this is corrected in v1.0?
Seems like a warning or error would make sense, since `qualified=True` with a fully qualified URL doesn't make much sense (since the URL is already qualified). The change would need to be made in Routes, specifically routes.util, probably somewhere in the block starting at line 396 (and line 251 for url_for). http://bitbucket.org/bbangert/routes/src/8e11f3126b88/routes/util.py#cl-396 -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
