58
|
1 |
from pytask.taskapp.models import Request
|
|
2 |
from datetime import datetime
|
|
3 |
|
|
4 |
def create_request(to,by,role):
|
|
5 |
"""
|
|
6 |
creates an unreplied request, based on the passed arguments
|
|
7 |
to - a list of users to which the notification is to be sent
|
|
8 |
by - sender of request
|
|
9 |
role - a two character field which represents the role requested
|
|
10 |
"""
|
|
11 |
req = Request(creation_date=datetime.now())
|
|
12 |
req.by = by
|
|
13 |
req.reply_date = datetime(1970,01,01)
|
|
14 |
req.save()
|
|
15 |
req.to = to
|
|
16 |
req.role = role
|
|
17 |
req.save()
|