Kaydet (Commit) 7a6abfdd authored tarafından Malcolm Tredinnick's avatar Malcolm Tredinnick

Fixed #5444 -- Changed manipulator class construction to use type(), rather than…

Fixed #5444 -- Changed manipulator class construction to use type(), rather than types.ClassType(). Helps with Jython compatibility. Patch from Leo Soto.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6277 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 39814eeb
...@@ -9,7 +9,6 @@ from django.utils.datastructures import DotExpandedDict ...@@ -9,7 +9,6 @@ from django.utils.datastructures import DotExpandedDict
from django.utils.text import capfirst from django.utils.text import capfirst
from django.utils.encoding import smart_str from django.utils.encoding import smart_str
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
import types
def add_manipulators(sender): def add_manipulators(sender):
cls = sender cls = sender
...@@ -38,7 +37,7 @@ class ManipulatorDescriptor(object): ...@@ -38,7 +37,7 @@ class ManipulatorDescriptor(object):
bases = [self.base] bases = [self.base]
if hasattr(model, 'Manipulator'): if hasattr(model, 'Manipulator'):
bases = [model.Manipulator] + bases bases = [model.Manipulator] + bases
self.man = types.ClassType(self.name, tuple(bases), {}) self.man = type(self.name, tuple(bases), {})
self.man._prepare(model) self.man._prepare(model)
return self.man return self.man
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment