Code

Opened 7 years ago

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

Download all attachments as: .zip

Change History (4)

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

call super() instead Field-class-methods

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

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

comment:1 Changed 7 years ago by adrian

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

You're right -- good idea.

comment:2 Changed 7 years ago by adrian

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

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.