~netlandish/django-wiki

4d9ba1c8ce5fce733055e61f318fb178110a3a90 — Raffaele Salmaso 6 years ago 8b9c390
Remove BuildAttrsCompat.
1 files changed, 0 insertions(+), 17 deletions(-)

M src/wiki/compat.py
M src/wiki/compat.py => src/wiki/compat.py +0 -17
@@ 9,28 9,11 @@ except ImportError:


__all__ = [
    'BuildAttrsCompat',
    'get_default_engine',
    'include', 'url'
]


# Django 1.11 Widget.build_attrs has a different signature, designed for the new
# template based rendering. The previous version was more useful for our needs,
# so we restore that version.
# When support for Django < 1.11 is dropped, we should look at using the
# new template based rendering, at which point this probably won't be needed at all.
class BuildAttrsCompat:
    def build_attrs_compat(self, extra_attrs=None, **kwargs):
        "Helper function for building an attribute dictionary."
        attrs = self.attrs.copy()
        if extra_attrs is not None:
            attrs.update(extra_attrs)
        if kwargs is not None:
            attrs.update(kwargs)
        return attrs


def get_default_engine():
    """
    Django >= 2.1 Engine.get_default() behaviour