mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-29 20:23:45 +03:00
Correction to type adaption example, making it more transparent
This commit is contained in:
parent
1b48033345
commit
ab4afd0e2f
|
@ -145,7 +145,9 @@ geometric type:
|
||||||
... self.y = y
|
... self.y = y
|
||||||
|
|
||||||
>>> def adapt_point(point):
|
>>> 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)
|
>>> register_adapter(Point, adapt_point)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user