summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsmund Tokheim <tokheim@outlook.com>2014-11-02 14:15:51 +0100
committerAsmund Tokheim <tokheim@outlook.com>2014-11-02 14:15:51 +0100
commitab4afd0e2f9eaaff3553bf57f39d283adb4cd5b5 (patch)
tree602b73262d3f6c9bf8a18e3be85fbe5a8777b1c6
parent1b48033345c912ea60ff5fca822bef13c3400067 (diff)
downloadpsycopg2-ab4afd0e2f9eaaff3553bf57f39d283adb4cd5b5.tar.gz
Correction to type adaption example, making it more transparent
-rw-r--r--doc/src/advanced.rst4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/src/advanced.rst b/doc/src/advanced.rst
index dafb1f5..eecbcfd 100644
--- a/doc/src/advanced.rst
+++ b/doc/src/advanced.rst
@@ -145,7 +145,9 @@ geometric type:
... self.y = y
>>> def adapt_point(point):
- ... return AsIs("'(%s, %s)'" % (adapt(point.x), adapt(point.y)))
+ ... x = adapt(point.x).getquoted()
+ ... y = adapt(point.y).getquoted()
+ ... return AsIs("'(%s, %s)'" % (x, y))
>>> register_adapter(Point, adapt_point)