GithubHelp home page GithubHelp logo

Comments (7)

mateifl avatar mateifl commented on August 15, 2024

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

from notification.models import NoticeType
from django.utils.translation import ugettext_noop as _

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

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

from pinax-notifications.

blag avatar blag commented on August 15, 2024

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.

from pinax-notifications.

kinkerl avatar kinkerl commented on August 15, 2024

this fix works for me too

from pinax-notifications.

benje avatar benje commented on August 15, 2024

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

from pinax-notifications.

groovecoder avatar groovecoder commented on August 15, 2024

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.

from pinax-notifications.

gmourier avatar gmourier commented on August 15, 2024

+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?).

from pinax-notifications.

grahamu avatar grahamu commented on August 15, 2024

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.

from pinax-notifications.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.