Skip to main content

jSpreadsheet table blocks for Wagtail

Project description

Wagtail Tables

jspreadsheet tables in Wagtail, edited and customised from the Wagtail admin

Getting started

Assuming you have a Wagtail project up and running:

pip install wagtailtables

Add wagtailtables to your settings.py in the INSTALLED_APPS section, before the core wagtail packages:

INSTALLED_APPS = [
    # ...
    'wagtailtables',
    # ...
]

Add a wagtailtables TableBlock to one of your StreamFields:

from wagtailtables.blocks import TableBlock

class ContentBlocks(StreamBlock):
    table_block = TableBlock()

Include your streamblock in one of your pages

class HomePage(Page):
    body = StreamField(ContentBlocks())

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

Simply render your table block as you would render any other block.

{% load wagtailcore_tags %}

{% block content %}
<div class="container-fluid">
    <div class="row">
        <div class="col-6">
            <h1>{{self.title}}</h1>
            <div class="excerpt">{{self.excerpt|richtext}}</div>
        </div>
    </div>
    {% for block in self.body %}
        {% include_block block %}
    {% endfor %}
</div>
{% endblock %}

Dependencies

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Built Distribution

wagtailtables-0.1-py3-none-any.whl (178.5 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page