1616from forums .config import VIDEO_PATH
1717from website .templatetags .permission_tags import can_edit
1818from spoken_auth .models import FossCategory
19- from forums . sortable import SortableHeader , get_sorted_list , get_field_index
19+ from sortable import SortableHeader , get_sorted_list , get_field_index
2020from django .db .models import Count
2121
2222
@@ -39,7 +39,7 @@ def home(request):
3939
4040
4141def questions (request ):
42- questions = Question .objects .filter (status = 1 ).order_by ('category' ,'tutorial' )
42+ questions = Question .objects .filter (status = 1 ).order_by ('category' , 'tutorial' )
4343 questions = questions .annotate (total_answers = Count ('answer' ))
4444
4545 raw_get_data = request .GET .get ('o' , None )
@@ -50,7 +50,7 @@ def questions(request):
5050 3 : SortableHeader ('minute_range' , True , 'Mins' ),
5151 4 : SortableHeader ('second_range' , True , 'Secs' ),
5252 5 : SortableHeader ('title' , True , 'Title' ),
53- 6 : SortableHeader ('date_modified ' , True , 'Date' ),
53+ 6 : SortableHeader ('date_created ' , True , 'Date' ),
5454 7 : SortableHeader ('views' , True , 'Views' ),
5555 8 : SortableHeader ('total_answers' , 'True' , 'Answers' ),
5656 9 : SortableHeader ('username' , False , 'User' )
@@ -559,8 +559,8 @@ def ajax_keyword_search(request):
559559 if request .method == "POST" :
560560 key = request .POST ['key' ]
561561 questions = Question .objects .filter (
562- Q (title__icontains = key )| Q (category__icontains = key )|
563- Q (tutorial__icontains = key )| Q (body__icontains = key ), status = 1 )
562+ Q (title__icontains = key )| Q (category__icontains = key )|
563+ Q (tutorial__icontains = key )| Q (body__icontains = key ), status = 1 )
564564 context = {
565565 'questions' : questions
566566 }
0 commit comments