def to_url(self, values): return ",".join([BaseConverter.to_url(value) for value in values])
def __init__(self, url_map): BaseConverter.__init__(self, url_map) self.regex = r'(?i)(?:WQL)'
def to_url(self, values): """ 被url_for()调用,来转换参数成为符合URL的形式 """ return '+'.join(BaseConverter.to_url(value) for value in values)
def to_url(self, value): self.set_item(value) return BaseConverter.to_url(self, value.name)
def __init__(self, url_map): BaseConverter.__init__(self, url_map) self.regex = r'[a-zA-Z_][a-zA-Z0-9_]*'
def to_url(self, value): """Convert datetime to string.""" return BaseConverter.to_url(self, str(value))
def __init__(self, url_map, ext): BaseConverter.__init__(self, url_map) self.regex = '[^/].*?(?:{})'.format(ext)
def __init__(self, map, seperator=u'/'): BaseConverter.__init__(self, map) self.seperator = seperator
def __init__(self, *args, **kwargs): BaseConverter.__init__(self, *args, **kwargs) self.type_ = "string" self.regex = '[^(/;)]+'
def to_url(self, values): """Return string.""" return '+'.join(BaseConverter.to_url(value) for value in values)
def __init__(self, url_map): BaseConverter.__init__(self, url_map) self.regex = (r'(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}' r'==|[A-Za-z0-9_-]{3}=)?')
def to_url(self, value): return BaseConverter.to_url(str(value))
def __init__(self, map): BaseConverter.__init__(self, map) self.regex = '\w+(?:-\w+)*'
def __init__(self, *args, **kwargs): BaseConverter.__init__(self, *args, **kwargs) self.type_ = "string"
def __init__(self, map): BaseConverter.__init__(self, map) self.fixed_digits = 64
def to_url(self, values): return self.separator.join( BaseConverter.to_url(value) for value in values)
def to_url(self, value): value = address_encoder(value) return BaseConverter.to_url(value)
def to_url(self, values): return '+'.join(BaseConverter.to_url(self, value) for value in values)
def __init__(self, url_map): BaseConverter.__init__(self, url_map) self.regex = '[^/].*?/'
def to_url(self, value): self.set_category(value) return BaseConverter.to_url(self, value.name)
def __init__(self, map, *valid_versions): BaseConverter.__init__(self, map) self.valid_versions = valid_versions
def __init__(self, url_map): BaseConverter.__init__(self, url_map) self.regex = '(?:%s)' % '|'.join([re.escape(x) for x in items])
def __init__(self, map): BaseConverter.__init__(self, map) self.regex = '(?:%s)' % '|'.join([re.escape(x) for x in NEWS_URLS])
def __init__(self, mapping, *items): BaseConverter.__init__(self, mapping) # Start by enforcing that x is an integer then convert it to string self.regex = '(?:%s)' % '|'.join([str(int(x)) for x in items])
def to_url(self, value): return BaseConverter.to_url(value)
def to_url(self, values): return "[{0}]".format( ','.join(BaseConverter.to_url(value) for value in values) #pylint: disable=no-value-for-parameter )
def to_url(self, values): print(1111111111, values) return self.separator.join(BaseConverter.to_url(value) for value in values)
def __init__(self, map, *args): BaseConverter.__init__(self,map) self.map = map self.regex = args[0]
def __init__(self, map, *items): BaseConverter.__init__(self, map) self.regex = items[0]
def to_url(self, values): if len(values) > 2: # Strip out everything extra values = values[:2] return ':'.join(BaseConverter.to_url(value) for value in values)
def __init__(self, map, *items): BaseConverter.__init__(self, map) self.items = items
def to_url(self, values): return ','.join(BaseConverter.to_url(value) for value in values)