From c8882ed7642246283089e9329a3addd56b17b8a7 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Fri, 25 Oct 2024 21:36:08 +0200 Subject: [PATCH] fix: v3 compatibility --- README.rst | 4 ++-- djangocms_link/admin.py | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 468022f5..35587038 100644 --- a/README.rst +++ b/README.rst @@ -143,9 +143,9 @@ You can run tests by executing:: .. |coverage| image:: https://codecov.io/gh/divio/djangocms-link/branch/master/graph/badge.svg :target: https://codecov.io/gh/divio/djangocms-link -.. |python| image:: https://img.shields.io/badge/python-3.5+-blue.svg +.. |python| image:: https://img.shields.io/badge/python-3.10+-blue.svg :target: https://pypi.org/project/djangocms-link/ -.. |django| image:: https://img.shields.io/badge/django-2.2,%203.0,%203.1-blue.svg +.. |django| image:: https://img.shields.io/badge/django-4.2,%205.0,%205.1-blue.svg :target: https://www.djangoproject.com/ .. |djangocms| image:: https://img.shields.io/badge/django%20CMS-3.7%2B-blue.svg :target: https://www.django-cms.org/ diff --git a/djangocms_link/admin.py b/djangocms_link/admin.py index 07b83dba..f2d83464 100644 --- a/djangocms_link/admin.py +++ b/djangocms_link/admin.py @@ -6,13 +6,17 @@ from django.views.generic.list import BaseListView from cms import __version__ -from cms.models import Page, PageContent +from cms.models import Page from cms.utils import get_language_from_request from . import models _version = int(__version__.split(".")[0]) +if _version >= 4: + from cms.models import PageContent +else: + from cms.models import Title as PageContent class UrlsJsonView(BaseListView):