summaryrefslogtreecommitdiff
path: root/taskapp/utilities/request.py
blob: af66319e566b9e8162c291e4e3b81b9f47966b3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from pytask.taskapp.models import Request
from datetime import datetime

def create_request(to,by,role):
    """
    creates an unreplied request, based on the passed arguments
        to - a list of users to which the notification is to be sent
        by - sender of request
        role - a two character field which represents the role requested
    """
    req = Request(creation_date=datetime.now())
    req.by = by
    req.reply_date = datetime(1970,01,01)
    req.save()
    req.to = to
    req.role = role
    req.save()