How to display notifications from `django-notification`?

I read the docs for django-notification, and they seem to describe the creation of notifications very well, but not how to display them to users. Is there any good recommendation for this and my google foo just let me down? If not, can someone give me some pointers here? Thanks.

+5
source share
2 answers

Answer: you need to create it in your own templates. It can be as simple as the following snippet:

<table>
    <caption>{% trans "Notices" %}</caption> 
    <thead>
        <tr>
            <th>{% trans "Type" %}</th>
            <th>{% trans "Message" %}</th>
            <th>{% trans "Date of the Notice" %}</th>
        </tr>
    </thead>
    <tbody>
        {% for notice in notices %}
            {% if notice.is_unseen %}
                <tr class="unseen_notice">
            {% else %}
                <tr class="notice">
            {% endif %}
                <td class="notice_type">[{% trans notice.notice_type.display %}]</td>
                <td class="notice_message">{{ notice.message|safe }}</td>
                <td class="notice_time">{{ notice.added|timesince }} {% trans "ago" %}</td>
            </tr>
        {% endfor %}
    </tbody>
</table>

@googletorp , Pinax - , django-notification. , , .

+3

Pinax github. http://code.pinaxproject.com.

Edit:
. , , Pinax, , - urls, .

+1

All Articles