def get_tags(obj): """ Get all tags that an object is tagged with :param obj: :return list of tags: """ id = obj._id coll_name = obj.__class__.coll_name() lis = Tag.collection().find({ "coll_name": coll_name, "obj_id": id, }) return [Tag.unserialize(dic) for dic in lis]