Code

Opened 7 years ago

Closed 7 years ago

#5993 closed (fixed)

define renderer for RadioSelect widget at the class level

Reported by: Max Derkachev <mderk@…> Owned by: nobody
Component: Forms Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: yes
Easy pickings: UI/UX:

Description

Currently the only standard way to customize radio field display is to pass custom renderer to the RadioSelect constructor.
The patch allows to define renderer for RadioSelect widget at the class level to allow redefine it in a subclass. E.g

class MyRadioFieldRenderer(RadioFieldRenderer):
    ..................

class MyRadioSelect(RadioSelect):
    renderer = MyRadioFieldRenderer

Attachments (1)

radioselect.patch (649 bytes) - added by Max Derkachev <mderk@…> 7 years ago.

Download all attachments as: .zip

Change History (3)

Changed 7 years ago by Max Derkachev <mderk@…>

comment:1 Changed 7 years ago by gwilson

  • Needs documentation unset
  • Needs tests set
  • Patch needs improvement set
  • Summary changed from [patch] newforms: define renderer for RadioSelect widget at the class level to define renderer for RadioSelect widget at the class level
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 7 years ago by gwilson

  • Resolution set to fixed
  • Status changed from new to closed

(In [6717]) Fixed #5993 -- Made RadioSelect easier to subclass by giving it a default renderer as a class attribute.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.