Add response.static_version to URL()

This commit is contained in:
gi0baro
2013-11-15 15:22:20 +01:00
parent 9bb4155460
commit e83bb7af29
+8
View File
@@ -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)