Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove id field from Resource #191

Merged
merged 2 commits into from
Nov 7, 2023
Merged

Remove id field from Resource #191

merged 2 commits into from
Nov 7, 2023

Conversation

mattt
Copy link
Contributor

@mattt mattt commented Nov 7, 2023

Related to #188

API resources define a common id field, which requires additional bookkeeping in _prepare_model. However, these fields aren't used, and either shadow a field on the resource or can be computed. This PR removes id from the base model, adds properties for subclasses that don't have an id field (like Hardware and Collection), and marks them as deprecated, for anyone who is relying on that behavior.

mattt added 2 commits November 7, 2023 10:20
Replace id with property for aliased fields

Signed-off-by: Mattt Zmuda <mattt@replicate.com>
Signed-off-by: Mattt Zmuda <mattt@replicate.com>
@mattt mattt merged commit db51ee0 into main Nov 7, 2023
@mattt mattt deleted the mattt/remove-id-field branch November 7, 2023 18:43
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant