utils.html.format_html_join()

format_html_join(sep, format_string, args_generator) [source]

A wrapper of format_html(), for the common case of a group of arguments that need to be formatted using the same format string, and then joined using sep. sep is also passed through conditional_escape().

args_generator should be an iterator that returns the sequence of args that will be passed to format_html(). For example:

format_html_join(
    '\n', "<li>{} {}</li>",
    ((u.first_name, u.last_name) for u in users)
)
doc_Django
2016-10-09 18:40:30
Comments
Leave a Comment

Please login to continue.