pytask/taskapp/utils.py
author Nishanth Amuluru <nishanth@fossee.in>
Tue, 11 Jan 2011 00:00:48 +0530
changeset 370 1be4a3c09a47
parent 344 aa61ea9c29f9
permissions -rw-r--r--
view textbook works fine

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