Without these, calling code such as the following on R being any InventreeObject, will fail:
dict(R)
'pk' in R
R.keys()
with an error something like this:
File "... inventree-python/inventree/base.py", line 310, in __getitem__
raise KeyError(f"Key '{name}' does not exist in dataset")
KeyError: "Key '0' does not exist in dataset"
After adding these methods, the above results in something like this:
Without these, calling code such as the following on
R
being any InventreeObject, will fail:with an error something like this:
After adding these methods, the above results in something like this: