From e83bb7af2949aed12d3e36b98264579450e5b844 Mon Sep 17 00:00:00 2001 From: gi0baro Date: Fri, 15 Nov 2013 15:22:20 +0100 Subject: [PATCH 1/2] Add response.static_version to URL() --- gluon/html.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gluon/html.py b/gluon/html.py index feac9423..dd925b0d 100644 --- a/gluon/html.py +++ b/gluon/html.py @@ -290,6 +290,14 @@ def URL( # if the url gets a static resource, don't force extention if controller == 'static': extension = None + # add static version to url + from globals import current + if hasattr(current, 'response'): + response = current.response + if response: + if response.static_version and response.static_version_urls: + args = [function] + args + function = '_'+str(response.static_version) if '.' in function: function, extension = function.rsplit('.', 1) From 2bf1f5396f7983e0561ffbc498cbf837cbed3143 Mon Sep 17 00:00:00 2001 From: gi0baro Date: Mon, 18 Nov 2013 01:12:37 +0100 Subject: [PATCH 2/2] Removed pedant if check in URL() --- gluon/html.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gluon/html.py b/gluon/html.py index dd925b0d..954a8825 100644 --- a/gluon/html.py +++ b/gluon/html.py @@ -294,10 +294,9 @@ def URL( from globals import current if hasattr(current, 'response'): response = current.response - if response: - if response.static_version and response.static_version_urls: - args = [function] + args - function = '_'+str(response.static_version) + if response.static_version and response.static_version_urls: + args = [function] + args + function = '_'+str(response.static_version) if '.' in function: function, extension = function.rsplit('.', 1)