Skip to main content

A fork of the wagtailnews plugin for Wagtail that provides news / blogging functionality. This fork exists to allow news items to belong to a collection, enforcing collection permissions and restrictions (including viewer restrictions, mirroring the Page queryset’s public() method and restricting unauthorized serving in the same way). This is done to facilitate wagtailnews working with the wagtailapproval plugin.

Installing

Install using pip:

pip install wagtailnews-collection

It works with Wagtail 1.4 and upwards.

Documentation

Documentation for Wagtail news can be found on Read The Docs. This fork has no specific documentation, as it works almost exactly the same.

Quick start

Create news models for your application that inherit from the relevant wagtailnews models:

from django.db import models

from wagtail.wagtailadmin.edit_handlers import FieldPanel
from wagtail.wagtailcore.fields import RichTextField
from wagtail.wagtailcore.models import Page

from wagtailnews.models import NewsIndexMixin, AbstractNewsItem, AbstractNewsItemRevision
from wagtailnews.decorators import newsindex


# The decorator registers this model as a news index
@newsindex
class NewsIndex(NewsIndexMixin, Page):
    # Add extra fields here, as in a normal Wagtail Page class, if required
    newsitem_model = 'NewsItem'


class NewsItem(AbstractNewsItem):
    # NewsItem is a normal Django model, *not* a Wagtail Page.
    # Add any fields required for your page.
    # It already has ``date`` field, and a link to its parent ``NewsIndex`` Page
    title = models.CharField(max_length=255)
    body = RichTextField()

    panels = [
        FieldPanel('title', classname='full title'),
        FieldPanel('body', classname='full'),
    ] + AbstractNewsItem.panels

    def __str__(self):
        return self.title


class NewsItemRevision(AbstractNewsItemRevision):
    newsitem = models.ForeignKey(NewsItem, related_name='revisions')

Metadata

Release files for wagtailnews-collection 0.17.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for wagtailnews-collection 0.17.11
File Interpreter ABI Platform
wagtailnews_collection-0.17.11-py2.py3-none-any.whl Python 3, Python 2 none any Details

Release files / wagtailnews_collection-0.17.11-py2.py3-none-any.whl

Download URL wagtailnews_collection-0.17.11-py2.py3-none-any.whl
Size 33.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
7c5d479e3c3eccc3669672cb3fc58f37a531332c32fd68839f63be85b0afc292
BLAKE2b-256 checksum
How to use checksums
2d250a01b6368c6930833e8e862bcf3c23b9a994491dc474fc8be35364066336
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.17.11 This release

1 release file

0.17.9

1 release file

0.17.8

1 release file

0.17.7

1 release file

0.17.6

1 release file

0.17.5

1 release file

0.17.4

1 release file

0.17.3

1 release file

0.17.2

1 release file

0.17.1

1 release file

0.17.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page