def get_tag(tag_name): coll = Tag.collection() dic = coll.find_one({"name": tag_name}) return Tag.unserialize(dic) if dic is not None else None