@app.template_filter('autoversion')
def autoversion_filter(filename):
    asset_version = get_asset_version(filename)
    if (asset_version is None):
        return filename
    original = urlparse(filename)._asdict()
    original.update(query=((original.get('query') + '&v=') + asset_version))
    return ParseResult(**original).geturl()
@app.template_filter('autoversion')
def autoversion_filter(filename):
    asset_version = get_asset_version(filename)
    if (asset_version is None):
        return filename
    original = urlparse(filename)._asdict()
    original.update(query=((original.get('query') + '&v=') + asset_version))
    return ParseResult(**original).geturl()