Open daxxog opened 1 year ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated |
---|---|---|---|
fastapi-crudrouter | ✅ Ready (Inspect) | Visit Preview | Jan 11, 2023 at 1:32PM (UTC) |
@daxxog thanks for this! Sorry for the delay. Would you be willing to add a test or two for this prior to merging?
@awtkns Sure I can do that!
@awtkns Is this along the lines of what you are looking for? https://github.com/awtkns/fastapi-crudrouter/pull/166/commits/8000bacadecb126a1149ff23f23073e248e96131
@awtkns Is this along the lines of what you are looking for? 8000bac
@awtkns Disregard my previous comment. I ran coverage and realized my diff to the tests wasn't even covering my feature. I got the tests to actually run against my feature, and then discovered a few issues, which I fixed.
Pydantic has a way to specify a function that provides a default value for a field.
This pull request adds support for this in fastapi-crudrouter, for primary keys that utilize this.
Example: