Django

Code

Changeset 6932

Show
Ignore:
Timestamp:
12/17/07 03:09:08 (1 year ago)
Author:
mtredinnick
Message:

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.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/management/commands/dumpdata.py

    r6922 r6932  
    3939        for app in app_list: 
    4040            for model in get_models(app): 
    41                 objects.extend(model.objects.all()) 
     41                objects.extend(model._default_manager.all()) 
    4242        try: 
    4343            return serializers.serialize(format, objects, indent=indent) 
  • django/trunk/docs/django-admin.txt

    r6747 r6932  
    132132 
    133133The output of ``dumpdata`` can be used as input for ``loaddata``. 
     134 
     135Note that ``dumpdata`` uses the default manager on the mdoel for selecting the 
     136records to dump. If you're using a `custom manager`_ as the default manager 
     137and it filters some of the available records, not all of the objects will be 
     138dumped. 
     139 
     140.. _custom manager: ../model-api/#custom-managers 
    134141 
    135142--format