mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
some more docs
This commit is contained in:
parent
a7279ce43e
commit
8708279629
@ -4,6 +4,7 @@ import importlib
|
|||||||
import pathlib
|
import pathlib
|
||||||
import logging
|
import logging
|
||||||
from typing import OrderedDict
|
from typing import OrderedDict
|
||||||
|
from importlib import reload
|
||||||
|
|
||||||
from django.apps import AppConfig, apps
|
from django.apps import AppConfig, apps
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
@ -217,7 +218,9 @@ class PluginAppConfig(AppConfig):
|
|||||||
settings.INTEGRATION_APPS_LOADING = False
|
settings.INTEGRATION_APPS_LOADING = False
|
||||||
self._reload_apps(populate=True)
|
self._reload_apps(populate=True)
|
||||||
self._reload_apps()
|
self._reload_apps()
|
||||||
|
# rediscover models/ admin sites
|
||||||
self._reload_contrib()
|
self._reload_contrib()
|
||||||
|
# update urls - must be last as models must be registered for creating admin routes
|
||||||
self._update_urls()
|
self._update_urls()
|
||||||
|
|
||||||
def _reload_contrib(self):
|
def _reload_contrib(self):
|
||||||
@ -247,6 +250,11 @@ class PluginAppConfig(AppConfig):
|
|||||||
reload(app_config.module.admin)
|
reload(app_config.module.admin)
|
||||||
|
|
||||||
def _get_plugin_path(self, plugin):
|
def _get_plugin_path(self, plugin):
|
||||||
|
"""parse plugin path
|
||||||
|
the input can be eiter:
|
||||||
|
- a local file / dir
|
||||||
|
- a package
|
||||||
|
"""
|
||||||
try:
|
try:
|
||||||
# for local path plugins
|
# for local path plugins
|
||||||
plugin_path = '.'.join(pathlib.Path(plugin.path).relative_to(settings.BASE_DIR).parts)
|
plugin_path = '.'.join(pathlib.Path(plugin.path).relative_to(settings.BASE_DIR).parts)
|
||||||
|
Loading…
Reference in New Issue
Block a user