Closed areski closed 6 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.
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.
this fix works for me too
Works for me too, would be great to get the docs updated :)
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.
+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?).
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.
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.