Пример #1
0
def comment(user_obj, comment_str, obj_id, coll_name):
    """
    Shortcut function for instantiating and commenting
    on an arbitrary object

    :param user_obj:
    :param comment_str:
    :param obj_id:
    :param coll_name:
    :return comment_obj_id:
    """
    comment_obj = Comment()
    comment_obj.user_id = user_obj._id
    comment_obj.comment = comment_str
    comment_obj.coll_name = coll_name
    comment_obj.obj_id = obj_id
    return save(comment_obj)