Opened 18 years ago

Closed 18 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: dev
Severity: Keywords: super
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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

Download all attachments as: .zip

Change History (4)

by Dirk Datzert <dummy@…>, 18 years ago

Attachment: newforms-fields-super.diff added

call super() instead Field-class-methods

by Dirk Datzert <dummy@…>, 18 years ago

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

comment:1 by Adrian Holovaty, 18 years ago

Triage Stage: UnreviewedAccepted

You're right -- good idea.

comment:2 by Adrian Holovaty, 18 years ago

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