Skip to content

Commit

Permalink
Migrate neomodel internals
Browse files Browse the repository at this point in the history
  • Loading branch information
Marius Conjeaud committed May 21, 2024
1 parent c465f54 commit fbbe19e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions django_neomodel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from django.core.exceptions import ValidationError

from neomodel import RequiredProperty, DeflateError, StructuredNode, UniqueIdProperty
from neomodel.core import NodeMeta
from neomodel.match import NodeSet
from neomodel.sync_.core import NodeMeta
from neomodel.sync_.match import NodeSet


__author__ = "Robin Edwards"
Expand Down
19 changes: 11 additions & 8 deletions django_neomodel/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
from neomodel import config


config.AUTO_INSTALL_LABELS = False


class NeomodelConfig(AppConfig):
name = 'django_neomodel'
verbose_name = 'Django neomodel'
name = "django_neomodel"
verbose_name = "Django neomodel"

def read_settings(self):
config.DATABASE_URL = getattr(settings, 'NEOMODEL_NEO4J_BOLT_URL', config.DATABASE_URL)
config.FORCE_TIMEZONE = getattr(settings, 'NEOMODEL_FORCE_TIMEZONE', False)
config.MAX_CONNECTION_POOL_SIZE = getattr(settings, 'NEOMODEL_MAX_CONNECTION_POOL_SIZE', config.MAX_CONNECTION_POOL_SIZE)
config.DATABASE_URL = getattr(
settings, "NEOMODEL_NEO4J_BOLT_URL", config.DATABASE_URL
)
config.FORCE_TIMEZONE = getattr(settings, "NEOMODEL_FORCE_TIMEZONE", False)
config.MAX_CONNECTION_POOL_SIZE = getattr(
settings,
"NEOMODEL_MAX_CONNECTION_POOL_SIZE",
config.MAX_CONNECTION_POOL_SIZE,
)

def ready(self):
self.read_settings()

0 comments on commit fbbe19e

Please sign in to comment.