Ticket #2363: base.py.patch

File base.py.patch, 651 bytes (added by anonymous, 9 years ago)
  • base.py

    old new  
    2222    "Metaclass for all models"
    2323    def __new__(cls, name, bases, attrs):
    2424        # If this isn't a subclass of Model, don't do anything special.
    25         if not 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)
    2727
    2828        # Create the class.
    2929        new_class = type.__new__(cls, name, bases, {'__module__': attrs.pop('__module__')})
Back to Top