-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
461 additions
and
102 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -5,3 +5,6 @@ build/ | |
dist/ | ||
.tox/ | ||
venv/ | ||
|
||
db.sqlite3 | ||
.coverage |
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
global-exclude *.py[cod] __pycache__ | ||
include LICENSE *.md | ||
graft wagtailmarkdown | ||
prune wagtailmarkdown/tests | ||
exclude .pre-commit-config.yaml runtests.py tox.ini | ||
exclude .pre-commit-config.yaml tox.ini venv db.sqlite3 .tox |
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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
import os | ||
import sys | ||
|
||
if __name__ == "__main__": | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "testapp.settings") | ||
|
||
from django.core.management import execute_from_command_line | ||
|
||
execute_from_command_line(sys.argv) |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env python | ||
import os | ||
import sys | ||
|
||
if __name__ == "__main__": | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "testapp.settings.dev") | ||
|
||
from django.core.management import execute_from_command_line | ||
|
||
execute_from_command_line(sys.argv) |
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Generated by Django 3.2.4 on 2021-06-18 11:36 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import wagtail.core.fields | ||
import wagtailmarkdown.blocks | ||
import wagtailmarkdown.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
("wagtailcore", "0059_apply_collection_ordering"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="TestPage", | ||
fields=[ | ||
( | ||
"page_ptr", | ||
models.OneToOneField( | ||
auto_created=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
parent_link=True, | ||
primary_key=True, | ||
serialize=False, | ||
to="wagtailcore.page", | ||
), | ||
), | ||
("body", wagtailmarkdown.fields.MarkdownField(blank=True)), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
bases=("wagtailcore.page",), | ||
), | ||
migrations.CreateModel( | ||
name="TestWithStreamFieldPage", | ||
fields=[ | ||
( | ||
"page_ptr", | ||
models.OneToOneField( | ||
auto_created=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
parent_link=True, | ||
primary_key=True, | ||
serialize=False, | ||
to="wagtailcore.page", | ||
), | ||
), | ||
( | ||
"body", | ||
wagtail.core.fields.StreamField( | ||
[ | ||
( | ||
"markdown", | ||
wagtailmarkdown.blocks.MarkdownBlock(icon="code"), | ||
) | ||
], | ||
blank=True, | ||
), | ||
), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
bases=("wagtailcore.page",), | ||
), | ||
] |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from wagtail.admin.edit_handlers import StreamFieldPanel | ||
from wagtail.core.blocks import StreamBlock | ||
from wagtail.core.fields import StreamField | ||
from wagtail.core.models import Page | ||
|
||
from wagtailmarkdown.blocks import MarkdownBlock | ||
from wagtailmarkdown.edit_handlers import MarkdownPanel | ||
from wagtailmarkdown.fields import MarkdownField | ||
|
||
|
||
class TestPage(Page): | ||
body = MarkdownField(blank=True) | ||
content_panels = [MarkdownPanel("body")] | ||
|
||
|
||
class MyStreamBlock(StreamBlock): | ||
markdown = MarkdownBlock(icon="code") | ||
|
||
|
||
class TestWithStreamFieldPage(Page): | ||
body = StreamField(MyStreamBlock, blank=True) | ||
content_panels = [StreamFieldPanel("body")] |
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import os | ||
|
||
BASE_DIR = os.path.dirname(os.path.abspath(__file__)) | ||
|
||
SECRET_KEY = "fake_secret_key_to_run_tests" # pragma: allowlist secret | ||
|
||
INSTALLED_APPS = [ | ||
"django.contrib.auth", | ||
"django.contrib.contenttypes", | ||
"django.contrib.sessions", | ||
"django.contrib.messages", | ||
"django.contrib.staticfiles", | ||
"wagtail.documents", | ||
"wagtail.images", | ||
"wagtail.users", | ||
"wagtail.core", | ||
"wagtail.admin", | ||
"taggit", | ||
"wagtailmarkdown", | ||
"testapp", | ||
] | ||
|
||
TEMPLATES = [ | ||
{ | ||
"BACKEND": "django.template.backends.django.DjangoTemplates", | ||
"DIRS": [], | ||
"APP_DIRS": True, | ||
"OPTIONS": { | ||
"context_processors": [ | ||
"django.template.context_processors.debug", | ||
"django.template.context_processors.request", | ||
"django.contrib.auth.context_processors.auth", | ||
], | ||
}, | ||
}, | ||
] | ||
|
||
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": "db.sqlite3"}} | ||
|
||
MEDIA_ROOT = os.path.join(BASE_DIR, "media") | ||
|
||
STATIC_ROOT = os.path.join(BASE_DIR, "static") | ||
STATIC_URL = "/static/" | ||
|
||
ROOT_URLCONF = "testapp.urls" | ||
|
||
MIDDLEWARE = [ | ||
"django.middleware.common.CommonMiddleware", | ||
"django.contrib.sessions.middleware.SessionMiddleware", | ||
"django.middleware.csrf.CsrfViewMiddleware", | ||
"django.contrib.sessions.middleware.SessionMiddleware", | ||
"django.contrib.auth.middleware.AuthenticationMiddleware", | ||
] | ||
|
||
ALLOWED_HOSTS = ["*"] | ||
|
||
PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"] |
Empty file.
Oops, something went wrong.