Skip to content

Commit

Permalink
update setup.py + README
Browse files Browse the repository at this point in the history
  • Loading branch information
seb-b committed Aug 11, 2023
1 parent cd43b75 commit a42f13e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 10 deletions.
28 changes: 21 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ Install using pip::

It works with Wagtail 4.0 and upwards. For older versions of Wagtail see past releases.

Documentation
=============

`Documentation for Wagtail news <http://wagtail-news.readthedocs.org>`_ can be found on Read The Docs

Quick start
===========
Expand All @@ -27,9 +23,9 @@ Create news models for your application that inherit from the relevant ``wagtail
from django.db import models
from wagtail.admin.edit_handlers import FieldPanel
from wagtail.core.fields import RichTextField
from wagtail.core.models import Page
from wagtail.admin.panels import FieldPanel
from wagtail.fields import RichTextField
from wagtail.models import Page
from wagtailnews.models import NewsIndexMixin, AbstractNewsItem, AbstractNewsItemRevision
from wagtailnews.decorators import newsindex
Expand All @@ -41,6 +37,18 @@ Create news models for your application that inherit from the relevant ``wagtail
# 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.
Expand All @@ -60,3 +68,9 @@ Create news models for your application that inherit from the relevant ``wagtail
class NewsItemRevision(AbstractNewsItemRevision):
newsitem = models.ForeignKey(NewsItem, related_name='revisions', on_delete=models.CASCADE)
Old docs
========

`The docs for Wagtail news <http://wagtail-news.readthedocs.org>`_ are severely out of date, but may still be useful for reference.
18 changes: 15 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
version=version,
description="News / blog plugin for the Wagtail CMS",
long_description=readme,
author="Tim Heap",
author_email="[email protected]",
url="https://github.com/takeflight/wagtailnews/",
author="Neon Jungle",
author_email="[email protected]",
url="https://github.com/neon-jungle/wagtailnews/",
install_requires=[
"wagtail>=4.0.0",
],
Expand All @@ -43,7 +43,19 @@
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Framework :: Django",
"Framework :: Django :: 3",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Wagtail",
"Framework :: Wagtail :: 4",
"Framework :: Wagtail :: 5",
"License :: OSI Approved :: BSD License",
],
)

0 comments on commit a42f13e

Please sign in to comment.