wagtail-cblocks


Namewagtail-cblocks JSON
Version 0.6.0 PyPI version JSON
download
home_pageNone
SummaryCollection of StreamField blocks for Wagtail
upload_time2025-09-18 12:36:02
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords blocks streamfield wagtail
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # wagtail-cblocks

A collection of StreamField blocks to use in Wagtail CMS.

**Warning!** This project is still early on in its development lifecycle. It is
possible for breaking changes to occur between versions until reaching a stable
1.0. Feedback and pull requests are welcome.

## Requirements

wagtail-cblocks requires the following:
- **Python 3** (3.9, 3.10, 3.11, 3.12, 3.13)
- **Django** (4.2 LTS, 5.2 LTS)
- **Wagtail** (6.3 LTS, 7.0 LTS, 7.1)

## Installation

1. Install using ``pip``:
   ```shell
   $ pip install wagtail-cblocks
   ```
2. Add ``wagtail_cblocks`` to your ``INSTALLED_APPS`` setting:
   ```python
   INSTALLED_APPS = [
       # ...
       'wagtail_cblocks',
       # ...
   ]
   ```

## Usage

Each block comes with a template made for Bootstrap 5 which is not shipped by
this plugin. If you plan to use them as is, you must have at least the Bootstrap
stylesheet loaded in your base template - refer as needed to the
[Bootstrap documentation](https://getbootstrap.com/).

In waiting for the documentation, here is a sample usage:

```python
from wagtail.admin.edit_handlers import StreamFieldPanel
from wagtail.blocks import StreamBlock
from wagtail.fields import StreamField
from wagtail.models import Page

from wagtail_cblocks.blocks import (
    ButtonBlock,
    ColumnsBlock,
    HeadingBlock,
    ImageBlock,
    ParagraphBlock,
)


class BaseBlock(StreamBlock):
    title_block = HeadingBlock()
    paragraph_block = ParagraphBlock()
    button_block = ButtonBlock()
    image_block = ImageBlock()


class BodyBlock(BaseBlock):
    columns_block = ColumnsBlock(BaseBlock())


class StandardPage(Page):
    body = StreamField(BodyBlock())

    content_panels = Page.content_panels + [
        StreamFieldPanel('body'),
    ]
```

Factories are also provided for some of the blocks to ease tests - see
[`wagtail_cblocks/factories.py`](wagtail_cblocks/factories.py). To make use of
them, install the extra *factories* requirements:

```shell
$ pip install wagtail-cblocks[factories]
```

## Development
### Quick start

To set up a development environment, ensure that Python 3 is installed on your
system. Then:

1. Clone this repository
2. Create a virtual environment and activate it:
   ```shell
   $ python3 -m venv venv
   $ source venv/bin/activate
   ```
3. Install this package and its requirements:
   ```shell
   (venv)$ pip install --editable ".[factories]" --group dev
   ```

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

### Contributing

The tests are written with [pytest] and code coverage is measured with [coverage].
You can use the following commands while developing:
- ``make test``: run the tests and output a quick report of code coverage
- ``make test-wip``: only run the tests marked as 'wip'
- ``make test-all``: run the tests on all supported versions of Django and
  Wagtail with [tox]

The Python code is formatted and linted thanks to [ruff]. You can check the code
with ``make lint`` and try to fix the reported issues with ``make format``.

When submitting a pull-request, please ensure that the code is well formatted
and covered, and that all the tests pass.

[pytest]: https://docs.pytest.org/
[coverage]: https://coverage.readthedocs.io/
[tox]: https://tox.wiki/
[ruff]: https://docs.astral.sh/ruff/

## License

This extension is mainly developed by [Cliss XXI](https://www.cliss21.com) and
licensed under the [AGPLv3+](LICENSE). Any contribution is welcome!

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "wagtail-cblocks",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "blocks, streamfield, wagtail",
    "author": null,
    "author_email": "Cliss XXI <contact@cliss21.com>",
    "download_url": "https://files.pythonhosted.org/packages/00/e0/5fbe65a445de271188d5482efacb5c3be5b57af3de2b94fad61479d5f74e/wagtail_cblocks-0.6.0.tar.gz",
    "platform": null,
    "description": "# wagtail-cblocks\n\nA collection of StreamField blocks to use in Wagtail CMS.\n\n**Warning!** This project is still early on in its development lifecycle. It is\npossible for breaking changes to occur between versions until reaching a stable\n1.0. Feedback and pull requests are welcome.\n\n## Requirements\n\nwagtail-cblocks requires the following:\n- **Python 3** (3.9, 3.10, 3.11, 3.12, 3.13)\n- **Django** (4.2 LTS, 5.2 LTS)\n- **Wagtail** (6.3 LTS, 7.0 LTS, 7.1)\n\n## Installation\n\n1. Install using ``pip``:\n   ```shell\n   $ pip install wagtail-cblocks\n   ```\n2. Add ``wagtail_cblocks`` to your ``INSTALLED_APPS`` setting:\n   ```python\n   INSTALLED_APPS = [\n       # ...\n       'wagtail_cblocks',\n       # ...\n   ]\n   ```\n\n## Usage\n\nEach block comes with a template made for Bootstrap 5 which is not shipped by\nthis plugin. If you plan to use them as is, you must have at least the Bootstrap\nstylesheet loaded in your base template - refer as needed to the\n[Bootstrap documentation](https://getbootstrap.com/).\n\nIn waiting for the documentation, here is a sample usage:\n\n```python\nfrom wagtail.admin.edit_handlers import StreamFieldPanel\nfrom wagtail.blocks import StreamBlock\nfrom wagtail.fields import StreamField\nfrom wagtail.models import Page\n\nfrom wagtail_cblocks.blocks import (\n    ButtonBlock,\n    ColumnsBlock,\n    HeadingBlock,\n    ImageBlock,\n    ParagraphBlock,\n)\n\n\nclass BaseBlock(StreamBlock):\n    title_block = HeadingBlock()\n    paragraph_block = ParagraphBlock()\n    button_block = ButtonBlock()\n    image_block = ImageBlock()\n\n\nclass BodyBlock(BaseBlock):\n    columns_block = ColumnsBlock(BaseBlock())\n\n\nclass StandardPage(Page):\n    body = StreamField(BodyBlock())\n\n    content_panels = Page.content_panels + [\n        StreamFieldPanel('body'),\n    ]\n```\n\nFactories are also provided for some of the blocks to ease tests - see\n[`wagtail_cblocks/factories.py`](wagtail_cblocks/factories.py). To make use of\nthem, install the extra *factories* requirements:\n\n```shell\n$ pip install wagtail-cblocks[factories]\n```\n\n## Development\n### Quick start\n\nTo set up a development environment, ensure that Python 3 is installed on your\nsystem. Then:\n\n1. Clone this repository\n2. Create a virtual environment and activate it:\n   ```shell\n   $ python3 -m venv venv\n   $ source venv/bin/activate\n   ```\n3. Install this package and its requirements:\n   ```shell\n   (venv)$ pip install --editable \".[factories]\" --group dev\n   ```\n\nTo run the test app interactively, use ``tox -e interactive``, visit\n[http://127.0.0.1:8020/admin](http://127.0.0.1:8000/admin/) and log in\nwith `admin` / `changeme`.\n\n### Contributing\n\nThe tests are written with [pytest] and code coverage is measured with [coverage].\nYou can use the following commands while developing:\n- ``make test``: run the tests and output a quick report of code coverage\n- ``make test-wip``: only run the tests marked as 'wip'\n- ``make test-all``: run the tests on all supported versions of Django and\n  Wagtail with [tox]\n\nThe Python code is formatted and linted thanks to [ruff]. You can check the code\nwith ``make lint`` and try to fix the reported issues with ``make format``.\n\nWhen submitting a pull-request, please ensure that the code is well formatted\nand covered, and that all the tests pass.\n\n[pytest]: https://docs.pytest.org/\n[coverage]: https://coverage.readthedocs.io/\n[tox]: https://tox.wiki/\n[ruff]: https://docs.astral.sh/ruff/\n\n## License\n\nThis extension is mainly developed by [Cliss XXI](https://www.cliss21.com) and\nlicensed under the [AGPLv3+](LICENSE). Any contribution is welcome!\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Collection of StreamField blocks for Wagtail",
    "version": "0.6.0",
    "project_urls": {
        "Issues": "https://framagit.org/cliss21/wagtail-cblocks/-/issues",
        "Repository": "https://framagit.org/cliss21/wagtail-cblocks"
    },
    "split_keywords": [
        "blocks",
        " streamfield",
        " wagtail"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "372ebc581143724a7dc14ef0e5a4de9ff9758b59e9d6ba1bfc6effe555107515",
                "md5": "04fa9abb57b96dab6d53b2823757812b",
                "sha256": "65582697f333fdfc6eb4e3690f4c741ef2647760bf9a7d9a70f2a3d6ce157175"
            },
            "downloads": -1,
            "filename": "wagtail_cblocks-0.6.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "04fa9abb57b96dab6d53b2823757812b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 26148,
            "upload_time": "2025-09-18T12:36:01",
            "upload_time_iso_8601": "2025-09-18T12:36:01.879887Z",
            "url": "https://files.pythonhosted.org/packages/37/2e/bc581143724a7dc14ef0e5a4de9ff9758b59e9d6ba1bfc6effe555107515/wagtail_cblocks-0.6.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "00e05fbe65a445de271188d5482efacb5c3be5b57af3de2b94fad61479d5f74e",
                "md5": "3f366049700dfdb63028069c2934b8a8",
                "sha256": "c1d7156a15553f826ce5de861927fb394b4a89b063d6f7eb5d14b2084648d4de"
            },
            "downloads": -1,
            "filename": "wagtail_cblocks-0.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3f366049700dfdb63028069c2934b8a8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 21991,
            "upload_time": "2025-09-18T12:36:02",
            "upload_time_iso_8601": "2025-09-18T12:36:02.934965Z",
            "url": "https://files.pythonhosted.org/packages/00/e0/5fbe65a445de271188d5482efacb5c3be5b57af3de2b94fad61479d5f74e/wagtail_cblocks-0.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-09-18 12:36:02",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "wagtail-cblocks"
}
        
Elapsed time: 3.00689s