[UPDT] HORILLA: Updated horilla global varriable APPS by declare them in every app ready() function

This commit is contained in:
Horilla
2025-01-31 10:50:59 +05:30
parent cc45e33430
commit c03cafd14f
11 changed files with 36 additions and 14 deletions

View File

@@ -1,8 +1,10 @@
import logging
import sys
from django.apps import AppConfig
from django.db import connection
from django.core.management import call_command
from django.db import connection
from dynamic_fields.methods import column_exists
logger = logging.getLogger(__name__)
@@ -17,10 +19,11 @@ class DynamicFieldsConfig(AppConfig):
name = "dynamic_fields"
def ready(self):
from dynamic_fields.models import DynamicField
from django.contrib.contenttypes.models import ContentType
from simple_history.models import HistoricalRecords
from dynamic_fields.models import DynamicField
try:
dynamic_objects = DynamicField.objects.filter()
# Ensure this logic only runs when the server is started (and only once)
@@ -52,8 +55,9 @@ class DynamicFieldsConfig(AppConfig):
logger.error(e)
logger.info("ignore if it is fresh installation")
from django.urls import include, path
from base.urls import urlpatterns
from django.urls import path, include
urlpatterns.append(
path("df/", include("dynamic_fields.urls")),