Reference: wagtail/wagtail#4298
Add fields.py
to your app. Replace usages of from wagtail.fields import StreamField
with from the_app.fields import StreamField
Reference: wagtail/wagtail#4298
Add fields.py
to your app. Replace usages of from wagtail.fields import StreamField
with from the_app.fields import StreamField
# myapp/management/commands/fix_alias_page_first_last_published.py | |
from django.core.management.base import BaseCommand | |
from django.db.models import Q | |
from wagtail.core.models import Page | |
class Command(BaseCommand): | |
def handle(self, **options): |
from wagtail.search.backends.elasticsearch7 import ( | |
Elasticsearch7Mapping, | |
Elasticsearch7SearchBackend, | |
Elasticsearch7SearchQueryCompiler, | |
Elasticsearch7SearchResults, | |
) | |
from .index import RootFilterField | |
[tool.black] | |
line-length = 120 | |
target-version = ['py38'] | |
exclude = ''' | |
( | |
/( | |
\.eggs # exclude a few common directories in the | |
| \.git # root of the project | |
| \.mypy_cache | |
| \.tox |
name: Publish docs to Netlify | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
name: Deploy docs | |
runs-on: ubuntu-latest |
/** | |
* Sets up routes and 404 any that match the 404 map | |
* @param {Request} request | |
*/ | |
async function handleRequest(request) { | |
let requestURL = new URL(request.url) | |
let path = requestURL.pathname | |
if (should404(path)) { | |
return new Response('Sorry, not found', { | |
status: 404 |
addEventListener("fetch", event => { | |
event.respondWith(fetchAndReplace(event.request)) | |
}) | |
async function fetchAndReplace(request) { | |
let modifiedHeaders = new Headers() | |
modifiedHeaders.set('Content-Type', 'text/html') | |
modifiedHeaders.append('Pragma', 'no-cache') |
name: MkDocs to GitHub Pages | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
deploy: |
Fetch the git SHA, with packed-refs support, and fallback to HEAD based on https://github.com/getsentry/raven-python/blob/25728c8190a7f008cdb00b1664cd4fd479060eaf/raven/versioning.py#L17