Skip to content

Enricher doesn't work on models with inheritance? #97

@lggwettmann

Description

@lggwettmann

Hey guys,

Some of the fields in my feeds don't get enriched if the target field points to a class that has been inherited. For models with inheritance, the PK is a one-to-one field. I don't know why but this line in enrich.Enricher._inject_objects() doesn't return an integer for the PK. Instead, the f_id stays a string which of course makes finding it impossible later on.

 f_id = model._meta.pk.to_python(f_id) 

I found that a simple cast to an integer works:

f_id = int(model._meta.pk.to_python(f_id))

Is this a bug? Could you check that and if possible push it? Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions