2016-08-08 16:43:11 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from django.apps import AppConfig
|
2019-09-11 06:46:39 +00:00
|
|
|
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()
|
2016-08-08 16:43:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
class AssetsConfig(AppConfig):
|
|
|
|
name = 'assets'
|
2017-12-12 04:19:45 +00:00
|
|
|
|
|
|
|
def ready(self):
|
|
|
|
super().ready()
|
2019-08-28 03:43:55 +00:00
|
|
|
from . import signals_handler
|
2019-09-11 06:46:39 +00:00
|
|
|
try:
|
|
|
|
initial_some_nodes()
|
|
|
|
except Exception:
|
|
|
|
post_migrate.connect(initial_some_nodes_callback, sender=self)
|