Opened 10 years ago

Closed 10 years ago

#3337 closed (fixed)

[patch] newforms-fields better calls super(CLASS,self) instead class-method Field

Reported by: Dirk Datzert <dummy@…> Owned by: Adrian Holovaty
Component: Forms Version: master
Severity: Keywords: super
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I looked into django.newforms.fields and saw that in the init() and the clean() method always calls to the Field.init() and Field.clean() method are made.

In an more object oriented way those calls should be better super(CLASSNAME, self).init() and super(CLASSNAME, self).clean()

Attachments (2)

newforms-fields-super.diff (7.0 KB) - added by Dirk Datzert <dummy@…> 10 years ago.
call super() instead Field-class-methods
newforms-fields-super.2.diff (6.9 KB) - added by Dirk Datzert <dummy@…> 10 years ago.
fixed errors in the call of super(CLASSNAME, self)

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by Dirk Datzert <dummy@…>

Attachment: newforms-fields-super.diff added

call super() instead Field-class-methods

Changed 10 years ago by Dirk Datzert <dummy@…>

fixed errors in the call of super(CLASSNAME, self)

comment:1 Changed 10 years ago by Adrian Holovaty

Triage Stage: UnreviewedAccepted

You're right -- good idea.

comment:2 Changed 10 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

(In [4366]) Fixed #3337 -- Changed newforms Field subclasses to use super(). Thanks for the patch, Dirk Datzert

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