mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-11 03:26:37 +03:00
Temporary hack to make the AsIs adapter work.
This commit is contained in:
parent
55744b00cd
commit
ab02141d48
|
@ -59,6 +59,7 @@ class Rect:
|
||||||
|
|
||||||
def __conform__(self, proto):
|
def __conform__(self, proto):
|
||||||
"""This is a terrible hack, just ignore proto and return self."""
|
"""This is a terrible hack, just ignore proto and return self."""
|
||||||
|
print "CONFORMIG!"
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def from_points(self, x0, y0, x1, y1):
|
def from_points(self, x0, y0, x1, y1):
|
||||||
|
|
|
@ -76,7 +76,7 @@ class AsIs(object):
|
||||||
|
|
||||||
psycopg 1.99.9 has some optimizations that make impossible to call adapt()
|
psycopg 1.99.9 has some optimizations that make impossible to call adapt()
|
||||||
without adding some basic adapters externally. This limitation will be
|
without adding some basic adapters externally. This limitation will be
|
||||||
lifted in a future release.In the meantime you can use the AsIs adapter.
|
lifted in a future release. In the meantime you can use the AsIs adapter.
|
||||||
"""
|
"""
|
||||||
def __init__(self, obj):
|
def __init__(self, obj):
|
||||||
self.__obj = obj
|
self.__obj = obj
|
||||||
|
@ -84,7 +84,8 @@ class AsIs(object):
|
||||||
return self.__obj
|
return self.__obj
|
||||||
def prepare(self, conn):
|
def prepare(self, conn):
|
||||||
pass
|
pass
|
||||||
|
__str__ = getquoted
|
||||||
|
|
||||||
class SQL_IN(object):
|
class SQL_IN(object):
|
||||||
"""Adapt any iterable to an SQL quotable object."""
|
"""Adapt any iterable to an SQL quotable object."""
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user