pytask/taskapp/utils.py
author Nishanth Amuluru <nishanth@fossee.in>
Wed, 12 Jan 2011 00:22:27 +0530
changeset 149 32dd15eaf9d0
parent 132 1be4a3c09a47
permissions -rw-r--r--
fixed a bug where guest users were not able to view the page correctly

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