diff options
author | hardythe1 | 2014-09-30 17:31:54 +0530 |
---|---|---|
committer | hardythe1 | 2014-09-30 17:31:54 +0530 |
commit | 23868831c777bb7fce75e2d24d20a6659d4f04d5 (patch) | |
tree | 29e78f07d5a0ec7da804671fb92ab25816ce709c /tbc | |
parent | c12f4b2715b56f8ccbdf2ace70ba584b72dc1dce (diff) | |
download | Python-TBC-Interface-23868831c777bb7fce75e2d24d20a6659d4f04d5.tar.gz Python-TBC-Interface-23868831c777bb7fce75e2d24d20a6659d4f04d5.tar.bz2 Python-TBC-Interface-23868831c777bb7fce75e2d24d20a6659d4f04d5.zip |
reverting back to order_by
Diffstat (limited to 'tbc')
-rwxr-xr-x | tbc/views.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tbc/views.py b/tbc/views.py index 21f059c..47637ad 100755 --- a/tbc/views.py +++ b/tbc/views.py @@ -451,8 +451,7 @@ def BookDetails(request, book_id=None): else: context['user'] = request.user book = Book.objects.get(id=book_id) - query = 'SELECT * from tbc_chapters where book_id = (SELECT id from tbc_book where id='+book_id+') ORDER BY LENGTH(name), name;' - chapters = Chapters.objects.raw(query) + chapters = Chapters.objects.filter(book=book).order_by('name') images = ScreenShots.objects.filter(book=book) context['chapters'] = chapters context['images'] = images @@ -465,8 +464,7 @@ def BookReview(request, book_id=None): if is_reviewer(request.user): if book_id: book = Book.objects.get(id=book_id) - query = 'SELECT * from tbc_chapters where book_id = (SELECT id from tbc_book where id='+book_id+') ORDER BY LENGTH(name), name;' - chapters = Chapters.objects.raw(query) + chapters = Chapters.objects.filter(book=book).order_by('name') images = ScreenShots.objects.filter(book=book) context['chapters'] = chapters context['images'] = images |