Opened 12 years ago

Closed 12 years ago

#17493 closed Cleanup/optimization (fixed)

Widget.id_for_label() should be an instance method

Reported by: Julien Phalip Owned by: nobody
Component: Forms Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I don't see any reason why Widget.id_for_label() should be a class method. What's more, it's actually already used as an instance method in some places. I suggest simply removing the classmethod decorators (see patch attached).

Attachments (1)

17493.diff (1.4 KB ) - added by Julien Phalip 12 years ago.

Download all attachments as: .zip

Change History (4)

by Julien Phalip, 12 years ago

Attachment: 17493.diff added

comment:1 by Claude Paroz, 12 years ago

Triage Stage: UnreviewedAccepted

I don't see any good reason either for this to be a class method. Small change still needed in a doc string in forms/forms.py: "Wrapper around the field widget's id_for_label class method." (remove "class")

comment:2 by Jannis Leidel, 12 years ago

Triage Stage: AcceptedReady for checkin

comment:3 by Julien Phalip, 12 years ago

Resolution: fixed
Status: newclosed

In [17452]:

Fixed #17493 -- Made Widget.id_for_label() consistently be an instance method.

Note: See TracTickets for help on using tickets.
Back to Top