oup/web2py/browse_thread/thread/5221c4a0e28640f8#, thanks Anthony

This commit is contained in:
Massimo Di Pierro
2012-02-27 16:58:01 -06:00
parent 65dc2026e0
commit ac4a2c8ea1
2 changed files with 10 additions and 6 deletions

View File

@@ -1 +1 @@
Version 1.99.4 (2012-02-27 08:52:23) stable
Version 1.99.4 (2012-02-27 16:57:41) stable

View File

@@ -233,6 +233,9 @@ def URL(
controller = None
function = None
if not isinstance(args, (list, tuple)):
args = [args]
if not r:
if a and not c and not f: (f,a,c)=(a,c,f)
elif a and c and not f: (c,f,a)=(a,c,f)
@@ -256,19 +259,20 @@ def URL(
function = f.__name__
else:
raise SyntaxError, 'when calling URL, function or function name required'
elif '.' in f:
function, extension = f.split('.', 1)
elif '/' in f:
items = f.split('/')
function = f = items[0]
args = items[1:] + args
else:
function = f
if '.' in function:
function, extension = function.split('.', 1)
function2 = '%s.%s' % (function,extension or 'html')
if not (application and controller and function):
raise SyntaxError, 'not enough information to build the url'
if not isinstance(args, (list, tuple)):
args = [args]
if args:
if url_encode:
if encode_embedded_slash: