Skip to content

[Question] Why is BaseResource._ids yielding primary keys twice ? #55

@cans

Description

@cans

The BaseResource._ids property yields all so called primary keys twice, once as the value of the attribute itself, once as the value of the attribute cast to a string with str.

Several questions about that:

  • Why doing so ? What is the use case ?
  • If there is a use case indeed, nothing prevents me to use an array, dict or object attribute as a key. What would be the meaning of str(object) ?

Not convinced that works well and since it is not used anywhere in the code, not sure there actually is a need for this.

Also as a side note, I think the name _pks is very much misleading. An entity can only have several keys but only one primary key (which is where I guess pk in _pks is coming from).

I welcome any feedback on this. Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions