Browse files

Fixed #6155 -- Fixed dumpdata to work with the default model manager …


for the rare cases when the 'objects' manager might not even exist). Based on
a  patch from Michael Trier.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 06482d4 commit 3edf2ebd9488bd57ceee9985b3ee7729e8a0f002 @malcolmt malcolmt committed Dec 17, 2007
Showing with 8 additions and 1 deletion.
  1. +1 −1 django/core/management/commands/
  2. +7 −0 docs/django-admin.txt
@@ -38,7 +38,7 @@ def handle(self, *app_labels, **options):
objects = []
for app in app_list:
for model in get_models(app):
- objects.extend(model.objects.all())
+ objects.extend(model._default_manager.all())
return serializers.serialize(format, objects, indent=indent)
except Exception, e:
@@ -132,6 +132,13 @@ If no application name is provided, all installed applications will be dumped.
The output of ``dumpdata`` can be used as input for ``loaddata``.
+Note that ``dumpdata`` uses the default manager on the mdoel for selecting the
+records to dump. If you're using a `custom manager`_ as the default manager
+and it filters some of the available records, not all of the objects will be
+.. _custom manager: ../model-api/#custom-managers

0 comments on commit 3edf2eb

Please sign in to comment.