You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
cans
changed the title
Why is BaseResource._ids yielding primary keys twice ?
[Question] Why is BaseResource._ids yielding primary keys twice ?
Nov 4, 2017
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 withstr
.Several questions about that:
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.
The text was updated successfully, but these errors were encountered: