oup/web2py/browse_thread/thread/5221c4a0e28640f8#, thanks Anthony
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 1.99.4 (2012-02-27 08:52:23) stable
|
Version 1.99.4 (2012-02-27 16:57:41) stable
|
||||||
|
|||||||
+9
-5
@@ -233,6 +233,9 @@ def URL(
|
|||||||
controller = None
|
controller = None
|
||||||
function = None
|
function = None
|
||||||
|
|
||||||
|
if not isinstance(args, (list, tuple)):
|
||||||
|
args = [args]
|
||||||
|
|
||||||
if not r:
|
if not r:
|
||||||
if a and not c and not f: (f,a,c)=(a,c,f)
|
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)
|
elif a and c and not f: (c,f,a)=(a,c,f)
|
||||||
@@ -256,19 +259,20 @@ def URL(
|
|||||||
function = f.__name__
|
function = f.__name__
|
||||||
else:
|
else:
|
||||||
raise SyntaxError, 'when calling URL, function or function name required'
|
raise SyntaxError, 'when calling URL, function or function name required'
|
||||||
elif '.' in f:
|
elif '/' in f:
|
||||||
function, extension = f.split('.', 1)
|
items = f.split('/')
|
||||||
|
function = f = items[0]
|
||||||
|
args = items[1:] + args
|
||||||
else:
|
else:
|
||||||
function = f
|
function = f
|
||||||
|
if '.' in function:
|
||||||
|
function, extension = function.split('.', 1)
|
||||||
|
|
||||||
function2 = '%s.%s' % (function,extension or 'html')
|
function2 = '%s.%s' % (function,extension or 'html')
|
||||||
|
|
||||||
if not (application and controller and function):
|
if not (application and controller and function):
|
||||||
raise SyntaxError, 'not enough information to build the url'
|
raise SyntaxError, 'not enough information to build the url'
|
||||||
|
|
||||||
if not isinstance(args, (list, tuple)):
|
|
||||||
args = [args]
|
|
||||||
|
|
||||||
if args:
|
if args:
|
||||||
if url_encode:
|
if url_encode:
|
||||||
if encode_embedded_slash:
|
if encode_embedded_slash:
|
||||||
|
|||||||
Reference in New Issue
Block a user