Comments (7)
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.
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.
this fix works for me too
from pinax-notifications.
Works for me too, would be great to get the docs updated :)
from pinax-notifications.
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.
+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.
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)
- Pass send_mail return values through backend.deliver
- Fix django3.2 deprecated / dropped features
- Call for Maintainers HOT 4
- the lock in send_all() [engine.py Line 41] doesn't work HOT 1
- Please update django-notification Pypi page to make it clear it's deprecated HOT 5
- Connection refused error HOT 1
- pinax-notifications 4.x won't install templates and locales HOT 5
- emit_notices management command and send_all have several errors
- Make it possible to use a language field stored on the user model directly
- Migration error when used with condottieri_notification HOT 5
- Improve documentation for building backends HOT 3
- App 'pinax.notifications' could not be found. Is it in INSTALLED_APPS? HOT 2
- account.models.Account doesn't declare an explicit app_label HOT 5
- Apps aren't loaded yet. HOT 2
- Post Insights Aktualisierung prüfen HOT 1
- How does pinax-notification choose the appropriate backend? HOT 2
- Why is NoticeType not just a simple Enum? HOT 2
- What's the difference between notice_type and medium?
- Do pinax work on lastes version of django? HOT 1
- When will the release happen for Django 3.0 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pinax-notifications.