oup/web2py/browse_thread/thread/5221c4a0e28640f8#, thanks Anthony
This commit is contained in:
2
VERSION
2
VERSION
@@ -1 +1 @@
|
||||
Version 1.99.4 (2012-02-27 08:52:23) stable
|
||||
Version 1.99.4 (2012-02-27 16:57:41) stable
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user