Ticket #7566: dumpdata-fix.patch
File dumpdata-fix.patch, 911 bytes (added by , 16 years ago) |
---|
-
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: