|
|
@ -1,6 +1,16 @@
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
|
|
|
|
from django.apps import AppConfig
|
|
|
|
from django.apps import AppConfig
|
|
|
|
|
|
|
|
from django.db.models.signals import post_migrate
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def initial_some_nodes():
|
|
|
|
|
|
|
|
from .models import Node
|
|
|
|
|
|
|
|
Node.initial_some_nodes()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def initial_some_nodes_callback(sender, **kwargs):
|
|
|
|
|
|
|
|
initial_some_nodes()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AssetsConfig(AppConfig):
|
|
|
|
class AssetsConfig(AppConfig):
|
|
|
@ -9,5 +19,7 @@ class AssetsConfig(AppConfig):
|
|
|
|
def ready(self):
|
|
|
|
def ready(self):
|
|
|
|
super().ready()
|
|
|
|
super().ready()
|
|
|
|
from . import signals_handler
|
|
|
|
from . import signals_handler
|
|
|
|
from .models import Node
|
|
|
|
try:
|
|
|
|
Node.initial_some_nodes()
|
|
|
|
initial_some_nodes()
|
|
|
|
|
|
|
|
except Exception:
|
|
|
|
|
|
|
|
post_migrate.connect(initial_some_nodes_callback, sender=self)
|
|
|
|