本文整理汇总了Python中notification.models.create_notice_type函数的典型用法代码示例。如果您正苦于以下问题:Python create_notice_type函数的具体用法?Python create_notice_type怎么用?Python create_notice_type使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了create_notice_type函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_notice_types
def create_notice_types(app, created_models, verbosity, **kwargs):
notification.create_notice_type(
'event_added',
_('Event Added'),
_('An event has been added'))
notification.create_notice_type(
'event_edited',
_('Event Edited'),
_('An event has been edited'))
notification.create_notice_type(
'event_deleted',
_('Event Deleted'),
_('An event has been deleted'))
notification.create_notice_type(
'event_registration_confirmation',
_('Event Registration Confirmation'),
_('The email you receive confirming your registration'))
notification.create_notice_type(
'event_registration_cancelled',
_('Event Registration Cancelled'),
_('Notify administrators that someone has cancelled their event registration'))
示例2: create_notice_types
def create_notice_types(app, created_models, verbosity, **kwargs):
notification.create_notice_type("friendship_requested",
_("Friendship Requested"), _("you have received a friend request"),
default=2)
notification.create_notice_type("friendship_accepted",
_("Friendship Accepted"), _("your friend request was accepted"),
default=2)
示例3: test_create_notice_type_with_same
def test_create_notice_type_with_same(self):
notice_type = create_notice_type("task new", "new task added", "task")
notice_type1 = create_notice_type("task new", "new task added11", "task")
notice_types = NoticeType.objects.filter(label=notice_type.label)
self.assertEqual(len(notice_types), 1)
notice_type.delete()
示例4: create_notice_types
def create_notice_types(app, created_models, verbosity, **kwargs):
notification.create_notice_type("distribution_fresh_list", _("Fresh List notice"), _("Here are the fresh foods available this week"), default=2)
notification.create_notice_type("distribution_pickup_list", _("Pickup List notice"), _("Here are the items to be picked up today"), default=2)
notification.create_notice_type("distribution_order_list", _("Order List notice"), _("Here are the orders to be delivered today"), default=2)
notification.create_notice_type("distribution_order_notice", _("Order Notice"), _("Here are the items ordered by this customer today"), default=2)
notification.create_notice_type("distribution_short_change_notice",
_("Short Change Notice"), _("Here are the short changes for this order"), default=2)
示例5: sendMail_RegisterUser
def sendMail_RegisterUser(senderuser,
receiveruser,
activity,
conjuction,
nid,
url=None):
nodeid = NID.objects.get(id=nid)
sys = nodeid.ref
if url == None:
url = sys.get_view_object_url
site = Site.objects.get_current()
render = render_to_string(
"/gstudio/notification/label.html", {
'sender': senderuser,
'activity': activity,
'conjunction': conjuction,
'object': sys.title,
'url': url,
'site': site
})
notification.create_notice_type(render, "Invitation Received",
"you have received an invitation")
notification.send(
receiveruser, render, {"from_user": senderuser}, sender=senderuser)
return
示例6: create_notice_types
def create_notice_types(app, created_models, verbosity, **kwargs):
notices = (
("badge_edited", _("Badge edited"),
_("one of your badges has been edited")),
("badge_awarded", _("Badge awarded"),
_("one of your badges has been awarded to someone")),
("award_received", _("Award received"),
_("you have been awarded a badge")),
#("award_accepted", _("Badge award accepted"),
# _("someone has accepted an award for one of your badges")),
#("award_declined", _("Badge award declined"),
# _("someone has declined an award for one of your badges")),
# TODO: Notification on progress?
("nomination_submitted", _("Nomination submitted"),
_("someone has submitted a nomination for one of your badges")),
("nomination_approved", _("Nomination approved"),
_("a nomination you submitted for an award has been approved")),
("nomination_rejected", _("Nomination rejected"),
_("a nomination you submitted for an award has been rejected")),
("nomination_received", _("Nomination received"),
_("a nomination to award you a badge was approved")),
("nomination_accepted", _("Nomination accepted"),
_("a nomination you submitted for an award has been accepted")),
)
for notice in notices:
notification.create_notice_type(*notice)
示例7: create_notice_types
def create_notice_types(app, created_models, verbosity, **kwargs):
notices = (
("welcome", _("Welcome"),
_(u"welcome to Mozilla Badges")),
("badge_edited", _(u"Badge edited"),
_(u"one of your badges has been edited")),
("badge_awarded", _(u"Badge awarded"),
_(u"one of your badges has been awarded")),
("team_badge_management", _(u"Team badge created"),
_(u"a new badge has been added to a team you manage")),
("team_follower_badge_created", _(u"Team badge created"),
_(u"a team you follow has created a new badge")),
("award_received", _(u"Award received"),
_(u"you have been awarded a badge")),
("award_accepted", _(u"Badge award accepted"),
_(u"someone has accepted an award for one of your badges")),
("award_declined", _(u"Badge award declined"),
_(u"someone has declined an award for one of your badges")),
("nomination_submitted", _(u"Nomination submitted"),
_(u"someone has submitted a nomination for one of your badges")),
("nomination_approved", _(u"Nomination approved"),
_(u"a nomination you submitted for an award has been approved")),
("nomination_rejected", _(u"Nomination rejected"),
_(u"a nomination you submitted for an award has been rejected")),
("nomination_received", _(u"Nomination received"),
_(u"a nomination to award you a badge was approved")),
("nomination_accepted", _(u"Nomination accepted"),
_(u"a nomination you submitted for an award has been accepted")),
)
for notice in notices:
notification.create_notice_type(*notice)
示例8: handle_noargs
def handle_noargs(self, **options):
self.stdout.write("Adofex-specific notice types\n")
for n in NOTICE_TYPES:
self.stdout.write("Creating %s\n" % n["label"])
notification.create_notice_type(n["label"], n["display"],
n["description"], n["default"])
self.stdout.write("Default set of notice types initialized successfully.\n")
示例9: create_notice_types
def create_notice_types(self):
if "notification" in settings.INSTALLED_APPS:
from notification import models as notification
notification.create_notice_type("wall_new_comment_your_post", _("New Comment on Wall Post You Created"), _("someone has commented on your wall post"))
notification.create_notice_type("wall_new_comment_your_comment", _("New Comment on Wall Post You Commented On"), _("someone has commented on a wall post you commented on"))
else:
print "Skipping creation of NoticeTypes as notification app not found"
示例10: create_notice_types
def create_notice_types(app, created_models, verbosity, **kwargs):
notification.create_notice_type("friends_invite", _("Invitation Received"), _("you have received an invitation"))
notification.create_notice_type("friends_accept", _("Acceptance Received"), _("an invitation you sent has been accepted"))
notification.create_notice_type("comment_receive", _("Comment Received"), _("you have received a comment"))
notification.create_notice_type("mentioned", _("Mentioned"), _("You have been mentioned"))
#so far, people can add friends without being approved
notification.create_notice_type("friends_add", _("Friend Added"), _("Someone added you as a friend"))
示例11: create_notice_type
def create_notice_type(self):
"""Create (or update) a notice type for discussion instance."""
create_notice_type(
label=self.notification_label,
display=self.notification_display,
description="A new post has been added .",
slug=self._meta.app_label,
default=0)
示例12: create_notice_types
def create_notice_types(app, created_models, verbosity, **kwargs):
notification.create_notice_type("presskitview_band_comment", _("band comment on presskit"), _("A band has commented a presskit view request"))
notification.create_notice_type("presskitview_venue_comment", _("venue comment on presskit"), _("A venue has commented a presskit view request"))
notification.create_notice_type("presskitview_accepted_by_venue", _("venue accepted to setup a gig"), _("A venue has accepted to set up a gig"))
notification.create_notice_type("presskitview_refused_by_venue", _("venue refused to setup a gig"), _("A venue has refused to set up a gig"))
notification.create_notice_type("presskitview_new", _("band proposed to set up gig to a venue"), _("A band has proposed to set up a gig"))
示例13: handle
def handle(self, *args, **options):
notification.create_notice_type("create_meeting_slot", _("Meeting slot created"), _("your new slot is ready"))
notification.create_notice_type("reserved_meeting_slot", _("Meeting has been accepted"), _("your meeting has accepted"))
notification.create_notice_type("cancel_meeting", _("Meeting cancelled"), _("your meeting has been cancelled"))
notification.create_notice_type("pre_meeting_reminder", _("Your upcoming meeting"), _("your meetings starts in 24 hours"))
notification.create_notice_type("post_meeting_feedback_request", _("Let us know"), _("how did your meeting go?"))
self.stdout.write('--> Created notice types')
示例14: create_notice_types
def create_notice_types(app, created_models, verbosity, **kwargs):
notification.create_notice_type('usergroups_application',
_("Application Received"),
_("someone has applied to join a "
"group"))
notification.create_notice_type('usergroups_application_approved',
_("Application Approved"),
_("someone has approved an "
"application to join a group"))
示例15: create_notice_types
def create_notice_types(app, created_models, verbosity, **kwargs):
notification.create_notice_type(
"new_reply", _("New reply"),
_("new reply to a post you're following"),
)
notification.create_notice_type(
"new_post", _("New post"),
_("new letter from an author or subject you're following"),
)