watson.framework.support.jinja2.filters

watson.framework.support.jinja2.filters.date(obj, format=None)[source]

Converts a datetime object to a string.

See https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior for formatting options.

Parameters:format – The output format of the date.
watson.framework.support.jinja2.filters.get_qualified_name(obj)[source]

Retrieve the qualified class name of an object.

watson.framework.support.jinja2.filters.label(obj)[source]

Render a form field with the label attached.

watson.framework.support.jinja2.filters.merge_query_string(obj, values)[source]

Merges an existing dict of query string values and updates the values.

Parameters:
  • obj – The original dict
  • values – The new query string values

Example:

# assuming ?page=2
request().get|merge_query_string({'page': 1})  # ?page=1