  
  class RadioSelect(Select):
  
      def __init__(self, *args, **kwargs):
          self.renderer = kwargs.pop('renderer', None)
          if not self.renderer:
              self.renderer = RadioFieldRenderer
          super(RadioSelect, self).__init__(*args, **kwargs)
  
      def get_renderer(self, name, value, attrs=None, choices=()):
          """Returns an instance of the renderer."""
          if value is None: value = ''
 
</s>
        # Override the default renderer if we were passed one.
        renderer = kwargs.pop('renderer', None)
        if renderer:
            self.renderer = renderer
  
  class RadioSelect(Select):
  
      def __init__(self, *args, **kwargs):
        # Override the default renderer if we were passed one.
        renderer = kwargs.pop('renderer', None)
        if renderer:
            self.renderer = renderer
        # Override the default renderer if we were passed one.
        renderer = kwargs.pop('renderer', None)
        if renderer:
            self.renderer = renderer
        # Override the default renderer if we were passed one.
        renderer = kwargs.pop('renderer', None)
        if renderer:
            self.renderer = renderer
          super(RadioSelect, self).__init__(*args, **kwargs)
  
      def get_renderer(self, name, value, attrs=None, choices=()):
          """Returns an instance of the renderer."""
          if value is None: value = ''
keep keep keep keep replace replace replace keep keep keep keep keep
 Fixed #5993 -- Made `RadioSelect` easier to subclass by giving it a default `renderer` as a class attribute.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6717 bcc190cf-cafb-0310-a4f2-bffc1f526a37
django/newforms/widgets.py