Commits

Andrew Godwin committed 5be8050

Don't require an exact model base class. Thanks to Sebastian Noack.

  • Participants
  • Parent commits 8e3b957

Comments (0)

Files changed (2)

south/creator/freezer.py

         depends.update(field_dependencies(field))
     # Add in any non-abstract bases
     for base in model.__bases__:
-        if issubclass(base, models.Model) and (base is not models.Model) and not base._meta.abstract:
+        if issubclass(base, models.Model) and hasattr(base, '_meta') and not base._meta.abstract:
             depends.add(base)
     # Now recurse
     new_to_check = depends - checked_models

south/modelsinspector.py

     
     # Go through all bases (that are themselves models, but not Model)
     for base in model.__bases__:
-        if base != models.Model and issubclass(base, models.Model):
+        if hasattr(base, '_meta') and issubclass(base, models.Model):
             if not base._meta.abstract:
                 # Looks like we need their fields, Ma.
                 inherited_fields.update(get_model_fields(base))
     # This is called _ormbases as the _bases variable was previously used
     # for a list of full class paths to bases, so we can't conflict.
     for base in model.__bases__:
-        if base != models.Model and issubclass(base, models.Model):
+        if hasattr(base, '_meta') and issubclass(base, models.Model):
             if not base._meta.abstract:
                 # OK, that matches our terms.
                 if "_ormbases" not in meta_def: