Skip to content

Commit

Permalink
Fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamu committed Nov 13, 2017
1 parent c67702f commit 833281e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 67 deletions.
84 changes: 18 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ configurable options as to how those notifications are to be received. `pinax-no
* Notification messages on signing in
* Notification messages via email (configurable by user)
* Ability to supply your own backend notification channels
* Ability to scope notifications at the site level

### Supported Django and Python Versions

Expand All @@ -36,47 +37,33 @@ configurable options as to how those notifications are to be received. `pinax-no
* [Installation](#installation)
* [Usage](#usage)
* [Settings](#settings)
* [Signals](#signals)
* [Scoping Notifications](#scoping-notifications)
* [Template Tags](#template-tags)
* [Change Log](#change-log)
* [Project History](#project-history)
* [About Pinax](#about-pinax)


## Installation

To install pinax-announcements:
To install pinax-notifications:

pip install pinax-announcements
pip install pinax-notifications

Add `pinax.announcements` to your `INSTALLED_APPS` setting:
Add `pinax.notifications` to your `INSTALLED_APPS` setting:

INSTALLED_APPS = (
...
"pinax.announcements",
"pinax.notifications",
...
)

Optionally, if you want someone other than staff to manage announcements,
enable this authentication backend:

AUTHENTICATION_BACKENDS = [
...
"pinax.announcements.auth_backends.AnnouncementPermissionsBackend",
...
]

then enable permission `"announcements.can_manage"` for these managers.

Lastly add `pinax.announcements.urls` to your project urlpatterns:

urlpatterns = [
...
url(r"^announcements/", include("pinax.announcements.urls", namespace="pinax_announcements")),
...
]

Add `pinax.notifications.urls` to your project urlpatterns:
+
+ urlpatterns = [
+ ...
+ url(r"^notifications/", include("pinax.notifications.urls", namespace="pinax_notifications")),
+ ...
+ ]

## Usage

Expand Down Expand Up @@ -239,8 +226,8 @@ you to override on a per call basis whether it should call `send_now` or

### Optional Notification Support

In case you want to use `pinax-notification` in your reusable app, you can wrap
the import of `pinax-notification` in a conditional clause that tests if it's
In case you want to use `pinax-notifications` in your reusable app, you can wrap
the import of `pinax-notifications` in a conditional clause that tests if it's
installed before sending a notice. As a result your app or project still
functions without notification.

Expand Down Expand Up @@ -363,27 +350,6 @@ using crontab setup to execute the `emit_notices` management command to send
queued messages rather than sending immediately.


## Signals

### pinax.announcements.signals.announcement_created

This signal is sent immediately after an announcement is created.
It provides a single `kwarg` of `announcement`, the created `Announcement` instance.
Sender is the newly created Announcement instance.

### pinax.announcements.signals.announcement_updated

This signal is sent immediately after an announcement is updated.
It provides a single `kwarg` of `announcement`, the updated `Announcement` instance.
Sender is the newly updated Announcement instance.

### pinax.announcements.signals.announcement_deleted

This signal is sent immediately after an announcement is deleted.
It provides a single `kwarg` of `announcement`, the deleted `Announcement` instance.
Sender is `None`.


## Scoping Notifications

Sometimes you have a site that has groups or teams. Perhaps you are using
Expand Down Expand Up @@ -424,28 +390,14 @@ Then override the url:
)


## Template Tags

### announcements

Filters announcements by `publish_start` and `publish_end` date range, including
all with no `publish_end` value.
Returns announcements matching `site_wide == True` and `members_only == False`,
and which are not dismissed.

{% announcements as announcement_list %}
{% for announcement in announcement_list %}
<div>
{{ announcement.title }}<br />
{{ announcement.content }}
</div>
{% endfor %}


## Change Log

_*BI*_ = backward incompatible change

### 4.1.1

* Fix installation documentation

### 4.1.0

* Add Django 2.0 compatibility testing
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
* Notification messages on signing in
* Notification messages via email (configurable by user)
* Ability to supply your own backend notification channels
* Ability to scope notifications at the site level
Supported Django and Python Versions
------------------------------------
Expand All @@ -53,7 +54,7 @@
description="User notification management for the Django web framework",
name="pinax-notifications",
long_description=LONG_DESCRIPTION,
version="4.1.0",
version="4.1.1",
url="http://github.com/pinax/pinax-notifications/",
license="MIT",
packages=find_packages(),
Expand Down

0 comments on commit 833281e

Please sign in to comment.