Merge pull request #271 from tokheim/master

Correction to type adaption example

It is OK for an adapted object to return the escaped string on 
__str__ calls but getquoted() is the canonical method.
This commit is contained in:
Federico Di Gregorio 2014-11-03 21:21:10 +01:00
commit 0d553269d5

View File

@ -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)