Skip to content

Importing fails or raises error for model that contains primary key which is not id #84

Open
@xalien10

Description

@xalien10

I was trying to import a model resource whose primary key is not the id. And when I'm trying to import it from the celery import admin section but it's failing and raising errors. But the same file is able to create/update rows using django-import-export import action.

This is my model resource

class RoleDetailResource(resources.ModelResource):

    class Meta:
        model = RoleDetail
        chunk_size = 5000
        import_id_fields = ("owner", )
        exclude = ("id", )

And I'm getting the following errors while importing,

Error with dry run:
with_dry_run

Error without dry run
without_dry_run

But import was successful with django-import-export action and row can be seen on the list:
import_with_django_import_export

@timthelion

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions