Skip to content
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

neomodel_inspect_database RelationshipTo model as string #799

Open
gastongutierrez opened this issue May 24, 2024 · 1 comment
Open

neomodel_inspect_database RelationshipTo model as string #799

gastongutierrez opened this issue May 24, 2024 · 1 comment

Comments

@gastongutierrez
Copy link

Expected Behavior (Mandatory)

The model parameter should be assigned an object, not a string.

belongs_to = RelationshipTo("Marketing", "BELONGS_TO", cardinality=OneOrMore, model=BelongsToRel)

Actual Behavior (Mandatory)

The current script generates a string for the model parameter.

belongs_to = RelationshipTo("Marketing", "BELONGS_TO", cardinality=OneOrMore, model="BelongsToRel")

How to Reproduce the Problem

$ neomodel_inspect_database -db bolt://neo4j_username:neo4j_password@localhost:7687 --write-to yourapp/models.py

Simple Example

Datasets and Statements

Screenshots (where it's possibile)

Specifications (Mandatory)

Currently used versions

Versions

  • OS: MacOS 14.5 (23F79)
  • Library: neomodel
  • Neo4j: 5.19
@mariusconjeaud
Copy link
Collaborator

That is done on purpose, because the model that the RelationshipTo refers to is actually defined after the node itself. So if you pass an object, your class file will not like it and you would have to reorder, or turn into a string yourself anyway.
So I though I should make it a string straight away.

But, if you think it makes more sense, I could make sure that relationship models are always defined before any nodes ; or I don't pass it a string and let users fix the model as they see fit ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants