From 34ddb90df32f71cb3dcae2b024789848823ba622 Mon Sep 17 00:00:00 2001 From: anoop Date: Tue, 23 Feb 2010 14:31:54 +0530 Subject: added utilities for creating notification. --- taskapp/utilities/notification.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 taskapp/utilities/notification.py (limited to 'taskapp/utilities/notification.py') diff --git a/taskapp/utilities/notification.py b/taskapp/utilities/notification.py new file mode 100644 index 0000000..816e8bf --- /dev/null +++ b/taskapp/utilities/notification.py @@ -0,0 +1,16 @@ +from pytask.taskapp.models import Notification +from datetime import datetime + +def create_notification(to,subject,message): + """ + creates a notification based on the passed arguments. + to - a list of users to which the notification is to be sent + subject - subject of the notification message to be sent + message - message body of the notification + """ + notification = Notification(sent_date = datetime.now()) + notification.save() + notification.to = to + notification.sub = subject + notification.message = message + notification.save() -- cgit