-
Notifications
You must be signed in to change notification settings - Fork 976
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
Pydantic for domain models? #91
Comments
I like pydantic too! but i've never tried it with the sqla mapper. maybe something more manual is the only way to go... |
let me know if you find a good solution! |
I would say - don't be afraid of boilerplate like this. a dumb function that maps a sqlalchemy row-dictionary to a pydantic class in a really mechanical way might feel really tedious and verbose, but it really isn't that much of a maintenance burden. |
oh and also-by-the-way -- if you enjoyed the book, i don't suppose you'd have time to write a quick review online somewhere? on amazon or goodreads or wherever you like to put reviews? they really help 😊 |
I'd be glad to leave a review everywhere I can, but I don't know where, could you give the urls? |
Hello. I really liked this book, it gives a fresh (for me) perspective at coding a web application, and it looks fantastic, very well written, not too difficult to understand. I finished the part 1 a couple of hours ago, it turned my perspective upside down, and I decided to give my new knowledge a try, just writing a small web service. And I encountered a problem: if I want to use pydantic to write my domain models, when I apply the SQLAlchemy mapper on them, the models stop working, they simply throw error at initializing. I really love pydantic, but I also ain't sure it's worth implementing smth like in django appendix just because I wanna use pydantic insteadof dataclasses and just classes.
The error:
AttributeError: 'User' object has no attribute 'pydantic_private'. Did you mean: 'pydantic_complete'?
The text was updated successfully, but these errors were encountered: