示例#1
0
def save_tag_log_attr(tag, obj_class):
    tag_log_obj = TagLog()
    tag_log_obj.tag_id = tag.obj_id()
    tag_log_obj.obj_class_name = obj_class.__name__
    tag_log_obj._id = save_tag_log(tag_log_obj)
    return tag_log_obj
示例#2
0
def get_tag_log(tag, obj_class):
    coll = TagLog.collection()
    dic = coll.find_one({"tag_id": tag.obj_id(), "obj_class_name": obj_class.__name__})
    return TagLog.unserialize(dic) if dic is not None else None
示例#3
0
def save_tag_log(tag_log_obj):
    coll = TagLog.collection()
    id = coll.save(tag_log_obj.serialize())
    return id