예제 #1
0
        def item2doc(item):
            port_codename = JsonTool.down(item, ["_id", cls.Field.PORT])
            tradegood_codename = JsonTool.down(item, ["_id", cls.Field.TRADEGOOD])

            price = merge_dicts([DictTool.keys2filtered(item, fields_others, ),
                                 {cls.Field.PORT: port_codename,
                                  cls.Field.TRADEGOOD: tradegood_codename,
                                  },
                                 ], vwrite=vwrite_no_duplicate_key
                                )

            return price
예제 #2
0
 def doc2pair(doc):
     doc_filter = DictTool.keys2filtered(doc, [Chatroom.Field.CODENAME])
     return (doc_filter, doc)
예제 #3
0
 def doc2pair(doc):
     doc_filter = DictTool.keys2filtered(doc, [cls.Field.CODENAME])
     return doc_filter, doc