def emit_compare(field_name, value, session, model):
    """Emit a comparison operation comparing the value of ``field_name`` on ``model`` to ``value``."""
    property = getattr(model, field_name)
    return property == value