Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation #50

Merged
merged 13 commits into from
Jul 31, 2024
Merged
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ With your preferred virtualenv activated, install testing dependencies:

```sh
python -m pip install --upgrade 'pip>=21.3'
python -m pip install -e '.[testing]' -U
python -m pip install -e '.[testing,ci,mailchimp,mrml]' -U
```

### Using flit
Expand Down Expand Up @@ -48,8 +48,8 @@ Now you can run tests as shown below:
tox
```

or, you can run them for a specific environment `tox -e python3.11-django4.2-wagtail5.1` or specific test
`tox -e python3.11-django4.2-wagtail5.1-sqlite wagtail-newsletter.tests.test_file.TestClass.test_method`
or, you can run them for a specific environment `tox -e python3.12-django5.0-wagtail6.1` or specific test
`tox -e python3.12-django5.0-wagtail6.1-sqlite wagtail-newsletter.tests.test_file.TestClass.test_method`

To run the test app interactively, use `tox -e interactive`, visit `http://127.0.0.1:8020/admin/` and log in with `admin`/`changeme`.

Expand Down
1 change: 1 addition & 0 deletions demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export WAGTAIL_NEWSLETTER_MAILCHIMP_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-us1
export WAGTAIL_NEWSLETTER_FROM_NAME="My Newsletter"
export [email protected]

python -m pip install --editable='.[testing,mailchimp,mrml]'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just realised we do have a CONTRIBUTING.md... But OK, I think this is a small worthwhile improvement 🙂

./demo/manage.py migrate
./demo/manage.py createcachetable
./demo/manage.py createsuperuser
Expand Down
4 changes: 2 additions & 2 deletions demo/fields.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import json

from wagtail.fields import StreamField as WagtailStreamfield
from wagtail.fields import StreamField as WagtailStreamField


class StreamField(WagtailStreamfield):
class StreamField(WagtailStreamField):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious to know what this override really is for, I don't understand why a demo project needs something like this 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, it's just to avoid migration noise from changes in the StreamField blocks definition. Originally I expected to be adding several block types in sequence to demo their features.

def __init__(self, *args, **kwargs):
"""
Overrides StreamField.__init__() to account for `block_types` no longer
Expand Down
2 changes: 1 addition & 1 deletion docs/customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ distinguish between newsletter and web rendering.
context["rendering_newsletter"] = True
return context

Then we can define a ``Streamfield`` block that only renders its content if the
Then we can define a ``StreamField`` block that only renders its content if the
flag is set (or, for web-only content, if the flag is missing):

.. code-block:: python
Expand Down