Opened 14 years ago
Closed 14 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)
Change History (4)
by , 14 years ago
| Attachment: | 17493.diff added |
|---|
comment:1 by , 14 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 14 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
Note:
See TracTickets
for help on using tickets.
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_labelclass method." (remove "class")