def _clear(self, fields=None):
    '''
    Sets all fields denoted by ``fields`` to None.

    If ``fields`` is empty, sets all fields to None.
    '''
    if not fields:
        val = None
        {%- for field in fields %}
        {{setter_variable_template|format(key=field)|indent(8)}}
        {%- endfor %}
        return self
    val = None
    {%- for field in fields %}
    if '{{field}}' in fields:
        {{setter_variable_template|format(key=field)|indent(8)}}
    {%- endfor %}
    return super()._clear()