Ticket #7566: 6155.diff
File 6155.diff, 1.5 KB (added by , 16 years ago) |
---|
-
django/core/management/commands/dumpdata.py
16 16 args = '[appname ...]' 17 17 18 18 def handle(self, *app_labels, **options): 19 from django.db.models import get_app, get_apps, get_models 19 from django.db.models import get_app, get_apps, get_models, query 20 20 21 21 format = options.get('format','json') 22 22 indent = options.get('indent',None) … … 43 43 objects = [] 44 44 for app in app_list: 45 45 for model in get_models(app): 46 objects.extend( model._default_manager.all())46 objects.extend(query.QuerySet(model).all()) 47 47 try: 48 48 return serializers.serialize(format, objects, indent=indent) 49 49 except Exception, e: -
docs/django-admin.txt
157 157 158 158 The output of ``dumpdata`` can be used as input for ``loaddata``. 159 159 160 Note that ``dumpdata`` uses the default manager on the model for selecting the161 records to dump. If you're using a `custom manager`_ as the default manager162 and it filters some of the available records, not all of the objects will be163 dumped.164 165 .. _custom manager: ../model-api/#custom-managers166 167 160 --exclude 168 161 ~~~~~~~~~ 169 162