فهرست منبع

Wagtail 2.16 upgrade (#470)

Co-authored-by: Roxanna Coldiron <roxanna@coderedcorp.com>
Co-authored-by: Vince Salvino <salvino@coderedcorp.com>
Roxanna Coldiron 2 سال پیش
والد
کامیت
6f55438d42

+ 4 - 4
azure-pipelines.yml

@@ -31,14 +31,14 @@ stages:
       vmImage: 'ubuntu-latest'
     strategy:
       matrix:
-        py3.6:
-          PYTHON_VERSION: '3.6'
         py3.7:
           PYTHON_VERSION: '3.7'
         py3.8:
           PYTHON_VERSION: '3.8'
         py3.9:
           PYTHON_VERSION: '3.9'
+        py3.10:
+          PYTHON_VERSION: '3.10'
 
     steps:
     - task: UsePythonVersion@0
@@ -85,7 +85,7 @@ stages:
     - task: UsePythonVersion@0
       displayName: 'Use Python version'
       inputs:
-        versionSpec: '3.9'
+        versionSpec: '3.10'
         architecture: 'x64'
 
     - script: python -m pip install -r requirements-ci.txt
@@ -130,7 +130,7 @@ stages:
     - task: UsePythonVersion@0
       displayName: 'Use Python version'
       inputs:
-        versionSpec: '3.9'
+        versionSpec: '3.10'
         architecture: 'x64'
 
     - script: python -m pip install -r requirements-ci.txt

+ 2 - 14
coderedcms/models/page_models.py

@@ -271,21 +271,9 @@ class CoderedPage(WagtailCacheMixin, SeoMixin, Page, metaclass=CoderedPageMeta):
     # Search
     ###############
 
-    search_fields = [
-        index.SearchField('title', partial_match=True, boost=3),
-        index.SearchField('seo_title', partial_match=True, boost=3),
+    search_fields = Page.search_fields + [
+        index.SearchField('seo_title', partial_match=True, boost=2),
         index.SearchField('search_description', boost=2),
-        index.FilterField('title'),
-        index.FilterField('id'),
-        index.FilterField('live'),
-        index.FilterField('owner'),
-        index.FilterField('content_type'),
-        index.FilterField('path'),
-        index.FilterField('depth'),
-        index.FilterField('locked'),
-        index.FilterField('first_published_at'),
-        index.FilterField('last_published_at'),
-        index.FilterField('latest_revision_created_at'),
         index.FilterField('index_show_subpages'),
         index.FilterField('index_order_by'),
         index.FilterField('custom_template'),

+ 6 - 0
coderedcms/project_template/basic/project_name/settings/base.py

@@ -185,6 +185,12 @@ WAGTAIL_SITE_NAME = '{{ sitename }}'
 
 WAGTAIL_ENABLE_UPDATE_CHECK = False
 
+WAGTAILSEARCH_BACKENDS = {
+    'default': {
+        'BACKEND': 'wagtail.search.backends.database',
+    }
+}
+
 # Base URL to use when referring to full URLs within the Wagtail admin backend -
 # e.g. in notification emails. Don't include '/admin' or a trailing slash
 BASE_URL = 'http://{{ domain }}'

+ 6 - 0
coderedcms/project_template/sass/project_name/settings/base.py

@@ -180,6 +180,12 @@ WAGTAIL_SITE_NAME = "{{ sitename }}"
 
 WAGTAIL_ENABLE_UPDATE_CHECK = False
 
+WAGTAILSEARCH_BACKENDS = {
+    'default': {
+        'BACKEND': 'wagtail.search.backends.database',
+    }
+}
+
 # Base URL to use when referring to full URLs within the Wagtail admin backend -
 # e.g. in notification emails. Don't include '/admin' or a trailing slash
 BASE_URL = 'http://{{ domain }}'

+ 0 - 1
coderedcms/static/coderedcms/css/codered-admin.css

@@ -185,7 +185,6 @@ input[type='checkbox']::before, input[type='radio']::before {
 
 .content {
     padding-bottom:100px;
-    background-color:unset;
 }
 
 .responsive-img {

+ 6 - 0
coderedcms/tests/settings.py

@@ -183,6 +183,12 @@ WAGTAIL_SITE_NAME = ""
 
 WAGTAIL_ENABLE_UPDATE_CHECK = False
 
+WAGTAILSEARCH_BACKENDS = {
+    'default': {
+        'BACKEND': 'wagtail.search.backends.database',
+    }
+}
+
 # Base URL to use when referring to full URLs within the Wagtail admin backend -
 # e.g. in notification emails. Don't include '/admin' or a trailing slash
 BASE_URL = ''

+ 11 - 1
docs/releases/v0.23.0.rst

@@ -5,6 +5,7 @@ v0.23.0 release notes
 New features
 ------------
 
+* Upgraded to Wagtail 2.16
 
 Bug fixes
 ---------
@@ -19,11 +20,20 @@ Maintenance
 Upgrade considerations
 ----------------------
 
+* Wagtail is now using a new search backend.
+
+  * Specify the `new default in your settings <https://docs.wagtail.org/en/stable/releases/2.15.html#database-search-backends-replaced>`_.
+
+  * Next, you will need to run the `update_index command <https://docs.wagtail.org/en/stable/reference/management_commands.html#update-index>`_.
+
+* Other upgrade considerations for `Wagtail 2.15 <https://docs.wagtail.org/en/stable/releases/2.15.html#upgrade-considerations>`_.
+
+* Other upgrade considerations for `Wagtail 2.16 <https://docs.wagtail.org/en/stable/releases/2.16.html#upgrade-considerations>`_.
 
 Supported software
 ------------------
 
-* Python 3.6, 3.7, 3.8, 3.9
+* Python 3.7, 3.8, 3.9
 
 * Django 3.0, 3.1, 3.2
 

+ 5 - 6
setup.py

@@ -27,30 +27,29 @@ setup(
         'Operating System :: OS Independent',
         'Programming Language :: Python',
         'Programming Language :: Python :: 3',
-        'Programming Language :: Python :: 3.6',
         'Programming Language :: Python :: 3.7',
         'Programming Language :: Python :: 3.8',
         'Programming Language :: Python :: 3.9',
+        'Programming Language :: Python :: 3.10',
         'Programming Language :: Python :: 3 :: Only',
         'Framework :: Django',
-        'Framework :: Django :: 3.0',
-        'Framework :: Django :: 3.1',
         'Framework :: Django :: 3.2',
+        'Framework :: Django :: 4.0',
         'Framework :: Wagtail',
         'Framework :: Wagtail :: 2',
         'Topic :: Internet :: WWW/HTTP',
         'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
         'Topic :: Internet :: WWW/HTTP :: Site Management',
     ],
-    python_requires='>=3.6',
+    python_requires='>=3.7',
     install_requires=[
         'beautifulsoup4>=4.8,<4.10',    # should be the same as wagtail
         'django-eventtools==1.0.*',
         'django-bootstrap4>=2.0,<2.4',
-        'Django>=3.0,<3.3',             # should be the same as wagtail
+        'Django>=3.2,<4.1',             # should be the same as wagtail
         'geocoder==1.38.*',
         'icalendar==4.0.*',
-        'wagtail==2.14.*',
+        'wagtail==2.16.*',
         'wagtailfontawesome>=1.2.*',
         'wagtail-cache==1.*',
         'wagtail-import-export>=0.2,<0.3',

+ 6 - 1
tutorial/mysite/mysite/settings/base.py

@@ -120,7 +120,6 @@ DATABASES = {
     }
 }
 
-
 # Password validation
 # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators
 
@@ -185,6 +184,12 @@ WAGTAIL_SITE_NAME = 'Simple Sweet Desserts Ltd.'
 
 WAGTAIL_ENABLE_UPDATE_CHECK = False
 
+WAGTAILSEARCH_BACKENDS = {
+    'default': {
+        'BACKEND': 'wagtail.search.backends.database',
+    }
+}
+
 # Base URL to use when referring to full URLs within the Wagtail admin backend -
 # e.g. in notification emails. Don't include '/admin' or a trailing slash
 BASE_URL = 'http://localhost'

+ 1 - 1
tutorial/mysite/requirements.txt

@@ -1,4 +1,4 @@
-coderedcms==0.21.*
+coderedcms==0.23.*
 
 # django_sendmail_backend enables sending email from your web host server.
 # Remove this if using a different email backend.