Ticket #2363: base.py.patch
File base.py.patch, 651 bytes (added by , 18 years ago) |
---|
-
base.py
old new 22 22 "Metaclass for all models" 23 23 def __new__(cls, name, bases, attrs): 24 24 # If this isn't a subclass of Model, don't do anything special. 25 if n ot bases or bases == (object,):26 return type.__new__(cls, name, bases, attrs)25 if name == 'Model' or not filter(lambda b: issubclass(b, Model), bases): 26 return super(ModelBase, cls).__new__(cls, name, bases, attrs) 27 27 28 28 # Create the class. 29 29 new_class = type.__new__(cls, name, bases, {'__module__': attrs.pop('__module__')})