from django_filters.widgets import RangeWidget


class CustomRangeWidget(RangeWidget):
    def __init__(self, widget, attrs=None):
        attrs_start = {'placeholder': 'От', **(attrs or {})}
        attrs_stop = {'placeholder': 'До', **(attrs or {})}
        widgets = (widget(attrs_start), widget(attrs_stop))
        super(RangeWidget, self).__init__(widgets, attrs)

    def format_output(self, rendered_widgets):
        rendered_widgets.insert(1, ' — ')
        return '<table class="range-widget"><tr><td>' + '</td><td>'.join(rendered_widgets) + '</td></tr></table>'

from django_filters.widgets import RangeWidget


class CustomRangeWidget(RangeWidget):
    def __init__(self, widget, attrs={}):
        attrs_start = {'placeholder': 'От'}
        attrs_start.update(attrs)
        attrs_stop = {'placeholder': 'До'}
        attrs_stop.update(attrs)
        super(RangeWidget, self).__init__((widget(attrs_start), widget(attrs_stop)), attrs)

    def format_output(self, rendered_widgets):
        rendered_widgets.insert(1, ' — ')
        return '<table class="range-widget"><tr><td>' + '</td><td>'.join(rendered_widgets) + '</td></tr></table>'

Make compatible with python 3.4
Make compatible with python 3.4

  from django_filters.widgets import RangeWidget
  
  
  class CustomRangeWidget(RangeWidget):
-     def __init__(self, widget, attrs=None):
+     def __init__(self, widget, attrs={}):
-         attrs_start = {'placeholder': 'От', **(attrs or {})}
+         attrs_start = {'placeholder': 'От'}
+         attrs_start.update(attrs)
-         attrs_stop = {'placeholder': 'До', **(attrs or {})}
+         attrs_stop = {'placeholder': 'До'}
-         widgets = (widget(attrs_start), widget(attrs_stop))
+         attrs_stop.update(attrs)
-         super(RangeWidget, self).__init__(widgets, attrs)
+         super(RangeWidget, self).__init__((widget(attrs_start), widget(attrs_stop)), attrs)
  
      def format_output(self, rendered_widgets):
          rendered_widgets.insert(1, ' — ')
          return '<table class="range-widget"><tr><td>' + '</td><td>'.join(rendered_widgets) + '</td></tr></table>'
  
Make compatible with python 3.4
## Code Before:
from django_filters.widgets import RangeWidget


class CustomRangeWidget(RangeWidget):
    def __init__(self, widget, attrs=None):
        attrs_start = {'placeholder': 'От', **(attrs or {})}
        attrs_stop = {'placeholder': 'До', **(attrs or {})}
        widgets = (widget(attrs_start), widget(attrs_stop))
        super(RangeWidget, self).__init__(widgets, attrs)

    def format_output(self, rendered_widgets):
        rendered_widgets.insert(1, ' — ')
        return '<table class="range-widget"><tr><td>' + '</td><td>'.join(rendered_widgets) + '</td></tr></table>'

## Instruction:
Make compatible with python 3.4
## Code After:
from django_filters.widgets import RangeWidget


class CustomRangeWidget(RangeWidget):
    def __init__(self, widget, attrs={}):
        attrs_start = {'placeholder': 'От'}
        attrs_start.update(attrs)
        attrs_stop = {'placeholder': 'До'}
        attrs_stop.update(attrs)
        super(RangeWidget, self).__init__((widget(attrs_start), widget(attrs_stop)), attrs)

    def format_output(self, rendered_widgets):
        rendered_widgets.insert(1, ' — ')
        return '<table class="range-widget"><tr><td>' + '</td><td>'.join(rendered_widgets) + '</td></tr></table>'
