Opened 4 years ago

Closed 4 years ago

#17493 closed Cleanup/optimization (fixed)

Widget.id_for_label() should be an instance method

Reported by: julien 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


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 4 years ago.

Download all attachments as: .zip

Change History (4)

Changed 4 years ago by julien

comment:1 Changed 4 years ago by claudep

  • Triage Stage changed from Unreviewed to Accepted

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/ "Wrapper around the field widget's id_for_label class method." (remove "class")

comment:2 Changed 4 years ago by jezdez

  • Triage Stage changed from Accepted to Ready for checkin

comment:3 Changed 4 years ago by julien

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

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