def build_sort():
sorts = request.args.getlist('<STR_LIT>')<EOL>sorts = [sorts] if isinstance(sorts, basestring) else sorts<EOL>sorts = [s.split('<STR_LIT:U+0020>') for s in sorts]<EOL>return [{SORTS[s]: d} for s, d in sorts if s in SORTS]<EOL>
Build sort query paramter from kwargs