Revised the documentation of the template tags.

This commit is contained in:
依瑪貓 2020-07-09 10:40:42 +08:00
parent 04ca928a3a
commit e1e61869b7

View File

@ -35,6 +35,9 @@ def setvar(context, key, value):
context (Context): the context context (Context): the context
key (str): The variable name key (str): The variable name
value (str): The variable value value (str): The variable value
Returns:
str: An empty string.
""" """
context.dicts[0][key] = value context.dicts[0][key] = value
return "" return ""
@ -46,7 +49,10 @@ def str_format(format_str, *args):
Args: Args:
format_str (str): The format. format_str (str): The format.
args (str): The parameters. args (*str): The arguments.
Returns:
str: The formatted text string.
""" """
return format_str.format(*args) return format_str.format(*args)
@ -58,6 +64,9 @@ def url_query(url, **kwargs):
Args: Args:
url (str): The URL. url (str): The URL.
kwargs (**dict): The query parameters. kwargs (**dict): The query parameters.
Returns:
str: The URL with query parameters set.
""" """
builder = UrlBuilder(url) builder = UrlBuilder(url)
for key in kwargs.keys(): for key in kwargs.keys():