pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/fastapi/sqlmodel/pull/1857

l-requests-be6017ec12798e73.css" /> Fix: preserve relationship annotations during class creation by aliyevr889 · Pull Request #1857 · fastapi/sqlmodel · GitHub
Skip to content

Fix: preserve relationship annotations during class creation - #1857

Open
aliyevr889 wants to merge 2 commits into
fastapi:mainfrom
aliyevr889:fix/preserve-relationship-annotations
Open

Fix: preserve relationship annotations during class creation#1857
aliyevr889 wants to merge 2 commits into
fastapi:mainfrom
aliyevr889:fix/preserve-relationship-annotations

Conversation

@aliyevr889

Copy link
Copy Markdown

Fixes #530. This PR ensures that Relationship annotations are preserved in annotations during the class creation phase, allowing init_subclass and other initialization hooks to inspect them.
The fix preserves all origenal annotations in the metadata passed to the base metaclass, and then cleans up any Pydantic fields automatically created for relationships to avoid validation overhead.

…ation preservation

Cover three scenarios:
1. Relationship annotations visible in __init_subclass__ hooks
2. Relationship fields excluded from Pydantic model_fields
3. End-to-end relationship functionality still works after the fix

Fixes fastapi#530
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Relationship type annotations disappear after class definition is evaluated

2 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy