-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support
LinkFormField
of djangocms-link 5+ (#241)
- Loading branch information
Showing
80 changed files
with
828 additions
and
1,390 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,4 @@ | |
13. Github actions will publish the new package to pypi | ||
""" | ||
|
||
__version__ = "2.0.0a" | ||
__version__ = "2.0.0a1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,68 @@ | ||
from django import apps | ||
from django.core import checks | ||
|
||
|
||
class DjangocmsFrontendConfig(apps.AppConfig): | ||
name = "djangocms_frontend" | ||
verbose_name = "DjangoCMS Frontend" | ||
verbose_name = "django CMS Frontend" | ||
|
||
def ready(self): | ||
from .component_pool import setup | ||
from . import plugin_tag | ||
|
||
setup() | ||
plugin_tag.setup() | ||
checks.register(check_settings) | ||
checks.register(check_installed_apps) | ||
|
||
|
||
def check_settings(*args, **kwargs): # pragma: no cover | ||
from django.conf import settings | ||
|
||
warnings = [] | ||
|
||
if hasattr(settings, "DJANGOCMS_FRONTEND_MINIMUM_INPUT_LENGTH"): | ||
warnings.append( | ||
checks.Warning( | ||
"The DJANGOCMS_FRONTEND_MINIMUM_INPUT_LENGTH setting was removed in djangocms-frontend 2.", | ||
"Use DJANGOCMS_LINK_MINIMUM_INPUT_LENGTH instead.", | ||
id="djangocms_frontend.W001", | ||
obj="settings.DJANGOCMS_FRONTEND_MINIMUM_INPUT_LENGTH", | ||
) | ||
) | ||
if hasattr(settings, "DJANGOCMS_FRONTEND_LINK_MODELS"): | ||
warnings.append( | ||
checks.Warning( | ||
"The DJANGOCMS_FRONTEND_LINK_MODELS setting was removed in djangocms-frontend 2. " | ||
"djangocms-frontend 2 uses linkable models from djangocms-link. See " | ||
"https://github.com/django-cms/djangocms-link#django-cms-link for more info.", | ||
"This message disappears after removing the DJANGOCMS_FRONTEND_LINK_MODELS from your " | ||
"project's settings.\n", | ||
id="djangocms_frontend.W002", | ||
obj="settings.DJANGOCMS_FRONTEND_LINK_MODELS", | ||
) | ||
) | ||
return warnings | ||
|
||
|
||
def check_installed_apps(*args, **kwargs): # pragma: no cover | ||
from django.conf import settings | ||
|
||
errors = [] | ||
link_contrib_apps = [ | ||
"djangocms_frontend.contrib.carousel", | ||
"djangocms_frontend.contrib.image", | ||
"djangocms_frontend.contrib.link", | ||
] | ||
link_apps_used = [app for app in link_contrib_apps if app in settings.INSTALLED_APPS] | ||
if link_apps_used: | ||
if "djangocms_link" not in settings.INSTALLED_APPS: | ||
errors.append( | ||
checks.Error( | ||
"djangocms-frontend requires djangocms-link to be installed for {}.".format( | ||
", ".join(link_apps_used) | ||
), | ||
"Add 'djangocms_link' to your INSTALLED_APPS setting or remove all of the above apps.", | ||
id="djangocms_frontend.E001", | ||
obj="settings.INSTALLED_APPS", | ||
) | ||
) | ||
return errors |
Oops, something went wrong.