From 3a2b90e1effd98ffbf71c9208ca1fd46fd65356f Mon Sep 17 00:00:00 2001 From: Joaquin Casares Date: Mon, 23 Sep 2013 16:35:42 -0500 Subject: [PATCH] Support nicer BoundStatement printing --- cassandra/query.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cassandra/query.py b/cassandra/query.py index c0143e22..36d66e47 100644 --- a/cassandra/query.py +++ b/cassandra/query.py @@ -213,6 +213,7 @@ class BoundStatement(Statement): "Too many arguments provided to bind() (got %d, expected %d)" % (len(values), len(col_meta))) + self.raw_values = values self.values = [] for value, col_spec in zip(values, col_meta): if value is None: @@ -263,6 +264,11 @@ class BoundStatement(Statement): else: return None + def __repr__(self): + consistency = ConsistencyLevel.value_to_name[self.consistency_level] + return (u'' % + (self.prepared_statement.query_string, self.raw_values, consistency)) + class ValueSequence(object): """