Skip to main content

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

  1. Clone the repo git clone https://github.com/mikemonteith/wagtail-streamfield-utils.git
  2. Install dependencies pip install -e .[testing]

Formatting

black .

Linting

flake8 .

Tests

pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wagtail-streamfield-migrate-0.0.1.tar.gz (5.5 kB view details)

Uploaded Source

File details

Details for the file wagtail-streamfield-migrate-0.0.1.tar.gz.

File metadata

  • Download URL: wagtail-streamfield-migrate-0.0.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.5

File hashes

Hashes for wagtail-streamfield-migrate-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d3ad8135bf4ae91b1aeead077fe72f04ede9b2ac9686eb40a0fec3d47534c6d3
MD5 a90c977b41d7519ed28d035f596b1837
BLAKE2b-256 6d472e0fb8a4d422f61147412b71ef70063447c3af2143714b5b44e99a857b29

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page