Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

…(necessary

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


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6932 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 3edf2ebd9488bd57ceee9985b3ee7729e8a0f002 1 parent 06482d4
Malcolm Tredinnick authored December 17, 2007
2  django/core/management/commands/dumpdata.py
@@ -38,7 +38,7 @@ def handle(self, *app_labels, **options):
38 38
         objects = []
39 39
         for app in app_list:
40 40
             for model in get_models(app):
41  
-                objects.extend(model.objects.all())
  41
+                objects.extend(model._default_manager.all())
42 42
         try:
43 43
             return serializers.serialize(format, objects, indent=indent)
44 44
         except Exception, e:
7  docs/django-admin.txt
@@ -132,6 +132,13 @@ If no application name is provided, all installed applications will be dumped.
132 132
 
133 133
 The output of ``dumpdata`` can be used as input for ``loaddata``.
134 134
 
  135
+Note that ``dumpdata`` uses the default manager on the mdoel for selecting the
  136
+records to dump. If you're using a `custom manager`_ as the default manager
  137
+and it filters some of the available records, not all of the objects will be
  138
+dumped.
  139
+
  140
+.. _custom manager: ../model-api/#custom-managers
  141
+
135 142
 --format
136 143
 ~~~~~~~~
137 144
 

0 notes on commit 3edf2eb

Please sign in to comment.
Something went wrong with that request. Please try again.