pinax / pinax-notifications

user notification management for the Django web framework
MIT License
752 stars 211 forks source link

Documentation create_notice_type #12

Closed areski closed 6 years ago

areski commented 11 years ago

Hi,

In the documentation we are referring to a method/function create_notice_type. Looking at the code in model, it seems that now this is called send_now or send.

mateifl commented 11 years ago

I think create_notice_type should be replace with NoticeType.create. Something like:

from notification.models import NoticeType from django.utils.translation import ugettextnoop as

def create_notice_types(): NoticeType.create("friendrequest", ("Friend request"), _("you have received a friend request"))

I tried this and it inserts the proper lines in the "notification_noticetype" table.

blag commented 11 years ago

I created this function in models.py because the django-friends app was attempting (and failing) to use this method in its friends/management.py file.

def create_notice_type(label, display, description, **kwargs):
    NoticeType.create(label, display, description, **kwargs)

After doing this, I get 0 errors from syncing the database.

kinkerl commented 11 years ago

this fix works for me too

benje commented 11 years ago

Works for me too, would be great to get the docs updated :)

groovecoder commented 11 years ago

The mis-match between the docs and code is still a pain in the ass. I'm using the 1.0 code which does not have create_notice_type even though the 1.0 docs on pypi indicate that it does.

gmourier commented 10 years ago

+1. The docs need a refresh. Btw this is not the right place to talk about it but docs need more information about how to use it properly like (displaying notification, mark as unread ?, read ?, context?).

grahamu commented 6 years ago

The documentation has been updated and properly refers to NoticeType.create(). See https://github.com/pinax/pinax-notifications/blob/master/README.md#creating-notice-types.