Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/neon-jungle/wagtailnews
News/blog plugin for Wagtail CMS
https://github.com/neon-jungle/wagtailnews
Last synced: 2 months ago
JSON representation
News/blog plugin for Wagtail CMS
- Host: GitHub
- URL: https://github.com/neon-jungle/wagtailnews
- Owner: neon-jungle
- License: bsd-2-clause
- Created: 2016-10-12T08:04:56.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-12-20T00:35:37.000Z (about 1 year ago)
- Last Synced: 2024-05-21T13:50:27.462Z (8 months ago)
- Language: Python
- Homepage: http://pypi.python.org/pypi/wagtailnews/
- Size: 233 KB
- Stars: 74
- Watchers: 7
- Forks: 21
- Open Issues: 3
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
- awesome-wagtail - wagtailnews - A plugin for Wagtail that provides news / blogging functionality. (Apps / Blogging/news)
README
===========
wagtailnews
===========A plugin for Wagtail that provides news / blogging functionality.
Installing
==========Install using pip::
pip install wagtailnews
It works with Wagtail 5.2 and upwards. For older versions of Wagtail see past releases.
Quick start
===========Create news models for your application that inherit from the relevant ``wagtailnews`` models:
.. code:: python
from django.db import models
from wagtail.admin.panels import FieldPanel
from wagtail.fields import RichTextField
from wagtail.models import Pagefrom 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'featured_news_item = models.ForeignKey(
'NewsItem',
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name='+',
)content_panels = Page.content_panels + [
FieldPanel('featured_news_item'), # This will set up a chooser for selecting a news item
]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.panelsdef __str__(self):
return self.titleclass NewsItemRevision(AbstractNewsItemRevision):
newsitem = models.ForeignKey(NewsItem, related_name='revisions', on_delete=models.CASCADE)Old docs
========`The docs for Wagtail news `_ are severely out of date, but may still be useful for reference.