Using neomodel's data models in place of pydantic

See original GitHub issue

I am making a fastapi server with neo4j database, and am using the neomodel driver for connecting to the database. I will have to create 2 seperate models, first in neomodel, second in pydantic (for request body validation and stuff). Is there a way to use the neomodel models in all the places where pydantic models are used in fastapi, if not could anyone point me in a direction to make the development experience as frictionless as possible.

Also, I am open to making a PR (if this is a feature that can be implemented), I’ll just need a little guidance because I don’t know the fastapi codebase.

BTW, thanks for the amazing library!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
dvjncommented, Oct 26, 2020

Damn, this is nice. I’d love to be able to do that. Hope this turns into a feature soon.

Anyways, thanks for your time and help @Kludex ♥ And, thanks for the library @tiangolo 🙌

0reactions
NFELcommented, Aug 30, 2022

Hey Guys, i really to integrate a feature like this as a plug-in feature to pydantic. Much like Odmantic, field mappings can be done to integrate default python + some extra fields around neomodel-properties. I like to work on a project like this …

Read more comments on GitHub >

github_iconTop Results From Across the Web

A brand new website interface for an even better experience!
Using neomodel's data models in place of pydantic.
Read more >
225: SELECT Pydantic FROM MongoDB - Python Bytes Podcast
Features: Familiar Django model style definitions. Powerful query API. Enforce your schema through cardinality restrictions. Full transaction ...
Read more >
How to transform data for Pydantic Models? - Stack Overflow
Below is how I would approach it with data coming from an API (as JSON). ... from pydantic import BaseModel, condecimal from datetime...
Read more >
Getting started — neomodel 4.0.8 documentation
Neomodel automatically creates a label for each StructuredNode class in the database with the corresponding indexes and constraints. Applying constraints and ...
Read more >
3.1. Pydantic Models - Python
More complex hierarchical data structures can be defined using models themselves as types in annotations. 3.1.4. ORM Mode (aka Arbitrary Class Instances)¶.
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