Wagtail utilities for streamfields
Project description
wagtail-streamfield-utils
API
iterators
flatten_streamfield(streamvalue)
Returns a generator, yielding (block, path) tuple to each block in a streamfield.
from streamfieldutils.iterators import flatten_streamfield
page = MyPage.objects.first()
# Print a slash-separated path to each block followed by the block's value.
for block, path in flatten_streamfield(page.body):
print("/".join(path), block.value)
Contributing
Getting started
- Clone the repo
git clone https://github.com/mikemonteith/wagtail-streamfield-utils.git
- Install dependencies
pip install -e .[testing]
Formatting
black .
Linting
flake8 .
Tests
pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for wagtail-streamfield-migrate-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3ad8135bf4ae91b1aeead077fe72f04ede9b2ac9686eb40a0fec3d47534c6d3 |
|
MD5 | a90c977b41d7519ed28d035f596b1837 |
|
BLAKE2b-256 | 6d472e0fb8a4d422f61147412b71ef70063447c3af2143714b5b44e99a857b29 |