|
|
|
@ -151,7 +151,9 @@ class CommentsResource(flask_restful.Resource):
|
|
|
|
|
if args['sort_order'] == 'random':
|
|
|
|
|
q = q.order_by(sqlalchemy.func.random())
|
|
|
|
|
elif args['sort_by']:
|
|
|
|
|
col = getattr(Comment, args['sort_by'], None)
|
|
|
|
|
col = getattr(Association, args['sort_by'], None)
|
|
|
|
|
if not col:
|
|
|
|
|
col = getattr(Comment, args['sort_by'], None)
|
|
|
|
|
if col:
|
|
|
|
|
if args['sort_order']:
|
|
|
|
|
order_by = getattr(col, args['sort_order'], None)
|
|
|
|
|