summaryrefslogtreecommitdiff
path: root/pytask/taskapp/utils.py
blob: 264c32b0b1a602024a5c195bb72ebd0ee0d7e88c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from pytask.taskapp.models import Task, TextBook
from django.http import Http404

def getTask(tid):

    try:
        task = Task.objects.get(uniq_key=tid)
        return task
    except Task.DoesNotExist:
        raise Http404

def getTextBook(tid):

    try:
        task = TextBook.objects.get(uniq_key=tid)
        return task
    except TextBook.DoesNotExist:
        raise Http404