Dumpdata fails if there is no objects default manager when Including your own custom manager. For example if we have a model that looks like:
class CategoryManager(models.Manager):
def find_django(self):
return self.filter(name='Django').order_by('name',)
class Category(models.Model):
name = models.CharField(max_length=50)
user = models.ManyToManyField(User)
active_objects = CategoryManager()
Since there is no objects attribute on the model when the following dumpdata code runs it will fail with an attribute error:
objects = []
for app in app_list:
for model in get_models(app):
objects.extend(model.objects.all())
See http://groups.google.com/group/django-users/browse_thread/thread/7a58d619aea92d9c for more information.
The fix is to modify the block so it looks like this:
objects = []
for app in app_list:
for model in get_models(app):
objects.extend(model._default_manager.all())