Ejemplo n.º 1
0
 def get(a_fun,
         a_db,
         a_id_list,
         a_field_list,
         a_limit="5000",
         a_order_list=[]):
     if not isinstance(a_db, (str, unicode)) or  not isinstance(a_id_list, list) or not isinstance(a_field_list, list) or \
        not isinstance(a_limit, (str, unicode)) or not isinstance(a_order_list, list):
         raise Exception(
             "_history.get argv error,  must be( str,list, list, str, list)"
         )
     if len(a_id_list) == 0 or len(a_field_list) == 0:
         return []
     t_field_list = []
     t_field_list = t_field_list + a_field_list
     t_field_list.append("#id")
     t_data = {
         "db": a_db,
         "field_array": t_field_list,
         "filter_array": [["#id", "in", a_id_list]],
         "limit": a_limit,
         "order_field_array": a_order_list
     }
     t_data_list = a_fun("c_history", "get_with_filter", t_data)
     return _lib.format_data(t_data_list, t_field_list)
Ejemplo n.º 2
0
 def modules(a_fun, a_db, a_module_type):
     t_module_list=[]
     t_field_list=["module", "is_link_task"]
     t_data_list=a_fun("c_module","get_with_filter",{"db":a_db, "field_array":t_field_list,"filter_array":[["type","=", "info"]]})
     t_new_data_list=_lib.format_data(t_data_list, t_field_list)
     for i in t_new_data_list:
         t_module=i["module"]
         t_is_link_task=i["is_link_task"]
         if unicode(a_module_type).strip().lower()=="task" and unicode(t_is_link_task).strip().lower()!="y":
             continue
         t_module_list.append(t_module)
     return t_module_list
Ejemplo n.º 3
0
 def get(a_fun, a_id_list, a_field_list):
     if not isinstance(a_id_list, list) or not isinstance(
             a_field_list, list):
         raise Exception("_plugin.get argv error,  must be(list, list)")
     if len(a_id_list) == 0 or len(a_field_list) == 0:
         return []
     t_field_list = []
     t_field_list = t_field_list + a_field_list
     t_field_list.append("#id")
     t_data = {
         "field_array": t_field_list,
         "filter_array": [["#id", "in", a_id_list]]
     }
     t_data_list = a_fun("c_plugin", "get_with_filter", t_data)
     return _lib.format_data(t_data_list, t_field_list)