pytask/taskapp/utils.py
author Nishanth Amuluru <nishanth@fossee.in>
Tue, 11 Jan 2011 11:30:14 +0530
changeset 137 40f1ef7a46d8
parent 132 1be4a3c09a47
permissions -rw-r--r--
added admin files

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