News / blog plugin for the Wagtail CMS
Project description
A plugin for Wagtail that provides news / blogging functionality.
Installing
Install using pip:
pip install wagtailnews
It works with Wagtail 0.7 and upwards.
Using
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
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 __unicode__(self):
return self.title
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wagtailnews-0.1.1.tar.gz
(7.8 kB
view details)
File details
Details for the file wagtailnews-0.1.1.tar.gz
.
File metadata
- Download URL: wagtailnews-0.1.1.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37069d218cc421fd8c7d2e17fa1ceca6f918d9a969d02c9cdca4d3f38fe29890 |
|
MD5 | 9eee7d78a6bf9101e16e21daa7205be0 |
|
BLAKE2b-256 | ea25260029d860208c80826035daae56b4b8ec8490523f709ebbdc946648cc89 |