author | Nishanth Amuluru <nishanth@fossee.in> |
Wed, 12 Jan 2011 00:22:27 +0530 | |
changeset 149 | 32dd15eaf9d0 |
parent 132 | 1be4a3c09a47 |
permissions | -rw-r--r-- |
132
1be4a3c09a47
view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
106
diff
changeset
|
1 |
from pytask.taskapp.models import Task, TextBook |
105 | 2 |
from django.http import Http404 |
3 |
||
4 |
def getTask(tid): |
|
5 |
||
6 |
try: |
|
106
aa61ea9c29f9
now deleted tasks are also selected in db query
Nishanth Amuluru <nishanth@fossee.in>
parents:
105
diff
changeset
|
7 |
task = Task.objects.get(uniq_key=tid) |
105 | 8 |
return task |
9 |
except Task.DoesNotExist: |
|
10 |
raise Http404 |
|
11 |
||
132
1be4a3c09a47
view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
106
diff
changeset
|
12 |
def getTextBook(tid): |
1be4a3c09a47
view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
106
diff
changeset
|
13 |
|
1be4a3c09a47
view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
106
diff
changeset
|
14 |
try: |
1be4a3c09a47
view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
106
diff
changeset
|
15 |
task = TextBook.objects.get(uniq_key=tid) |
1be4a3c09a47
view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
106
diff
changeset
|
16 |
return task |
1be4a3c09a47
view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
106
diff
changeset
|
17 |
except TextBook.DoesNotExist: |
1be4a3c09a47
view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
106
diff
changeset
|
18 |
raise Http404 |
1be4a3c09a47
view textbook works fine
Nishanth Amuluru <nishanth@fossee.in>
parents:
106
diff
changeset
|
19 |