Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add support for configurable primary keys on ORM models #145

Merged
merged 4 commits into from
Dec 3, 2020
Merged

Conversation

jlowin
Copy link
Member

@jlowin jlowin commented Dec 2, 2020

Summary

As we make heavier use of views, the assumption that every model has a corresponding id key is more likely to be validated. This PR makes each ORM model's primary key configurable. It does not replace existing uses of the word "id" as an argument (models.Flow.where(id=5)) because the headache would be... too much. However, models.CustomFlow.where(id=5) would work even if CustomFlow's primary key were a field other than id.

Importance

Checklist

This PR:

  • adds new tests (if appropriate)
  • adds a change file in the changes/ directory (if appropriate)

@codecov-io
Copy link

Codecov Report

Merging #145 (adfc8fb) into master (02911e9) will increase coverage by 0.21%.
The diff coverage is 100.00%.

@cicdw cicdw merged commit b959c34 into master Dec 3, 2020
@cicdw cicdw deleted the primary-key branch December 3, 2020 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants