  from django.conf import settings
  from django.core import serializers
  from django.core.management.base import BaseCommand
  from django.core.management.color import no_style
  from django.db import connections, router, transaction, DEFAULT_DB_ALIAS
  from django.db.models import get_apps
  from django.utils.itercompat import product
  
  try:
      import bz2
 
</s> remove                                             obj.save(using=using)
 </s> add                                             try:
                                                obj.save(using=using)
                                            except (DatabaseError, IntegrityError), e:
                                                msg = "Could not load %(app_label)s.%(object_name)s(pk=%(pk)s): %(error_msg)s" % {
                                                        'app_label': obj.object._meta.app_label,
                                                        'object_name': obj.object._meta.object_name,
                                                        'pk': obj.object.pk,
                                                        'error_msg': e
                                                    }
                                                raise e.__class__, e.__class__(msg), sys.exc_info()[2]
from django.db import (connections, router, transaction, DEFAULT_DB_ALIAS,
      IntegrityError, DatabaseError)
  from django.conf import settings
  from django.core import serializers
  from django.core.management.base import BaseCommand
  from django.core.management.color import no_style
from django.db import (connections, router, transaction, DEFAULT_DB_ALIAS,
      IntegrityError, DatabaseError)
  from django.db.models import get_apps
  from django.utils.itercompat import product
  
  try:
      import bz2
keep keep keep keep replace keep keep keep keep keep
 Fixed #16026 -- loaddata now identifies which object triggered an error.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@16873 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/core/management/commands/loaddata.py