support JSON type

This commit is contained in:
pycook
2019-12-23 18:51:33 +08:00
parent 6089039366
commit 2ba6a16613
12 changed files with 62 additions and 14 deletions

View File

@@ -1,5 +1,7 @@
# -*- coding:utf-8 -*-
import json
import redis
import six
from elasticsearch import Elasticsearch
@@ -26,6 +28,9 @@ def get_page_size(page_size):
def handle_arg_list(arg):
if isinstance(arg, six.string_types) and arg.startswith('['):
return json.loads(arg)
return list(filter(lambda x: x != "", arg.strip().split(","))) if isinstance(arg, six.string_types) else arg