Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1259 (closed enhancement: fixed)

Opened 12 years ago

Last modified 12 years ago

Checkbox widget doesn't allow another validator to be specified

Reported by: simonk Owned by: alberto
Priority: low Milestone: 1.0.2
Component: TG Widgets Version: 1.0
Severity: minor Keywords:
Cc:

Description

The CheckBox? widget is hardcoded to use a Bool validator. The constructor looks like this:

    def __init__(self, *args, **kw):
        super(CheckBox, self).__init__(*args, **kw)
        self.validator = validators.Bool()

I would like to use a StringBool? validator instead, but to do this I had to subclass the widget. It would be more flexible if the constructor looked like this:

    def __init__(self, *args, **kw):
        super(CheckBox, self).__init__(*args, **kw)
        if not self.validator:
            self.validator = validators.Bool()

(I think there is also an argument to be made for making StringBool? the default validator, but that is a much more far-reaching change)

Attachments

checkbox.patch Download (523 bytes) - added by simonk 12 years ago.
Patch against 1.0 branch

Change History

Changed 12 years ago by simonk

Patch against 1.0 branch

comment:1 Changed 12 years ago by alberto

  • Status changed from new to assigned
  • Owner changed from anonymous to alberto

comment:2 Changed 12 years ago by alberto

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

Patch got applied [2782] and is a dupe of #1328... err, actually its the opposite way around :/

Alberto

Note: See TracTickets for help on using tickets.