Opened 7 years ago

Closed 7 years ago

#7621 closed (fixed)

Use super(..., cls).__new__ instead of type.__new__ in metaclasses django.db.models.ModelBase and django.newforms.forms.DeclarativeFieldsMetaclass

Reported by: Christian Tanzer <tanzer@…> Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation:
Needs tests: Patch needs improvement:
Easy pickings: UI/UX:

Description

As discussed on django-developers@…, here is a patch for django.db.models.ModelBase.new and django.newforms.forms.DeclarativeFieldsMetaclass.new to use super instead of type to chain up.

Attachments (1)

metaclass.diff (1.7 KB) - added by Christian Tanzer <tanzer@…> 7 years ago.

Download all attachments as: .zip

Change History (2)

Changed 7 years ago by Christian Tanzer <tanzer@…>

comment:1 Changed 7 years ago by mtredinnick

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

(In [7846]) Fixed #7621 -- Enable superclassing of the various metaclasses we use.

Also tidy up some initialisation code in django.db.models.base.ModelBase.
Thanks, Christian Tanzer.

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