Skip to content

Commit

Permalink
Removed useless base classes
Browse files Browse the repository at this point in the history
Based on discussion here: neo4j-contrib#716 (comment)
  • Loading branch information
73VW committed Aug 10, 2023
1 parent d6ada57 commit 74bf4bd
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 15 deletions.
7 changes: 0 additions & 7 deletions neomodel/base.py

This file was deleted.

3 changes: 1 addition & 2 deletions neomodel/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from neo4j.exceptions import ClientError

from neomodel import config
from neomodel.base import BaseNode
from neomodel.exceptions import DoesNotExist, NodeClassAlreadyDefined
from neomodel.hooks import hooks
from neomodel.properties import Property, PropertyManager
Expand Down Expand Up @@ -315,7 +314,7 @@ def build_class_registry(cls):
NodeBase = NodeMeta("NodeBase", (PropertyManager,), {"__abstract_node__": True})


class StructuredNode(NodeBase, BaseNode):
class StructuredNode(NodeBase):
"""
Base class for all node definitions to inherit from.
Expand Down
4 changes: 1 addition & 3 deletions neomodel/relationship.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from neomodel.base import BaseRel

from .core import db
from .hooks import hooks
from .properties import Property, PropertyManager
Expand All @@ -22,7 +20,7 @@ def __new__(mcs, name, bases, dct):
StructuredRelBase = RelationshipMeta("RelationshipBase", (PropertyManager,), {})


class StructuredRel(StructuredRelBase, BaseRel):
class StructuredRel(StructuredRelBase):
"""
Base class for relationship objects
"""
Expand Down
3 changes: 0 additions & 3 deletions neomodel/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from neo4j.graph import Relationship

from neomodel import config, core
from neomodel.base import BaseNode, BaseRel
from neomodel.exceptions import (
ConstraintValidationFailed,
FeatureNotSupported,
Expand Down Expand Up @@ -66,9 +65,7 @@ def clear_neo4j_database(db, clear_constraints=False, clear_indexes=False):

class Path(NeoPath):
def __init__(self, nodes, *relationships):
assert all([isinstance(node, BaseNode) for node in nodes])
for i, relationship in enumerate(relationships, start=1):
assert isinstance(relationship, BaseRel)
start = relationship.start_node()
end = relationship.end_node()
if start not in nodes and end not in nodes:
Expand Down

0 comments on commit 74bf4bd

Please sign in to comment.