pydantic documentation suggestions
See original GitHub issueIn general the documentation looks pretty good but after using it for the last weeks i do have some remarks i feel like might need to be included in the documentation:
-
that you can chose to await or not, if you await it will fetch all foreign key objects (recursively). While this in many cases might be the intended behavior. it should def be mentioned that it will do this and that you need to blacklist the fields to not have this happen. also that not awaiting it at all will prevent this behavior (albeit with an error if not blacklisted). yes it’s listed in the function at the bottom. but most people will never look at this and go by the examples.
-
in the 2nd tutorial
print(Tournament_Pydantic_List .schema())
has some extra spacing. just looks funky -
it references “regular Pydantic-object methods”, probably worth adding a link back to the pydantic documentation here (https://pydantic-docs.helpmanual.io/usage/exporting_models/) for people who are not super familiar with pydantic or encountering it here for the first time
-
the early init tutorial is saying “uhow where is our relationship” but is about early init but none of the tutorials ever explicitly connect to any database since they are partial code snippets. i think it might be worth being explicit here and mentioning that you only need to do an early init if you need to create these models before you awaited the tortoise init
overall great docs, just some things to consider to make things more explicit and help new people find their way easier
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
looks a lot better as a starting point for new people. i might try my hand at some more examples later, though i guess those would be better suited later for a more general fastapi integration tutorial
We probably need tutorials of similar quality for Tortoise ORM itself…