question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pydantic documentation suggestions

See original GitHub issue

In 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:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
AEnterprisecommented, Mar 9, 2020

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

0reactions
grigicommented, Mar 9, 2020

We probably need tutorials of similar quality for Tortoise ORM itself…

Read more comments on GitHub >

github_iconTop Results From Across the Web

pydantic
Documentation for version: v1.10.2. Data validation and settings management using Python type annotations. pydantic enforces type hints at runtime, ...
Read more >
Pydantic V2 Plan
Data validation and settings management using Python type hints.
Read more >
The Beginner's Guide to Pydantic. A Python package to parse ...
Based on the official documentation, Pydantic is. “… primarily a parsing library, not a validation library. Validation is a means to an end:...
Read more >
pydantic — pydantic v0.28 documentation
pydantic uses those annotations to validate that untrusted data takes the form ... any other keyword arguments (eg. examples ) will be added...
Read more >
Pydantic - GitHub
Define how data should be in pure, canonical Python 3.7+; validate it with pydantic. Help. See documentation for more details. Installation.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found