Ticket #7566: dumpdata-fix.patch

File dumpdata-fix.patch, 911 bytes (added by anonymous, 7 years ago)
  • core/management/commands/dumpdata.py

     
    1616    args = '[appname ...]'
    1717
    1818    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
    2020
    2121        format = options.get('format','json')
    2222        indent = options.get('indent',None)
     
    4343        objects = []
    4444        for app in app_list:
    4545            for model in get_models(app):
    46                 objects.extend(model._default_manager.all())
     46                objects.extend(query.QuerySet(model).all())
    4747        try:
    4848            return serializers.serialize(format, objects, indent=indent)
    4949        except Exception, e:
Back to Top