Skip to content
Snippets Groups Projects
Commit 101c0fff authored by Kangmin Lee's avatar Kangmin Lee
Browse files

게시판 분류 추가

parent a0be3273
No related branches found
No related tags found
No related merge requests found
......@@ -14,19 +14,22 @@ class Main(APIView):
if user is None:
return render(request, 'user/login.html')
feed_object_list = Feed.objects.filter(univ=user.univ).order_by('-id')
##### 게시판 분류 및 정렬#####
##### 게시글 정렬 #####
type = request.GET.get('type', None)
order_condition = request.GET.get('order', None)
if type == 'photozone':
if order_condition == 'recent':
feed_object_list=Feed.objects.filter(univ=user.univ).order_by('-id')
feed_object_list = Feed.objects.filter(univ=user.univ, type=False).order_by('-id')
if order_condition == 'likesCount':
feed_object_list = Feed.objects.filter(univ=user.univ, type=False).order_by('-like_count')
if type == 'scene':
if order_condition == 'recent':
feed_object_list = Feed.objects.filter(univ=user.univ, type=True).order_by('-id')
if order_condition == 'likesCount':
feed_object_list=Feed.objects.filter(univ=user.univ).order_by('-like_count')
feed_object_list = Feed.objects.filter(univ=user.univ, type=True).order_by('-like_count')
print(order_condition)
print(feed_object_list)
####################
row_feed_list = []
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment