summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Trier <mtrier@gmail.com>2008-07-03 03:40:23 +0000
committerMichael Trier <mtrier@gmail.com>2008-07-03 03:40:23 +0000
commit0e857ffa32ebbb0886f2aaa2bf5a3f3d33545432 (patch)
treecdc3198f32f5814667e63c686f0cae6b411fa0d7
parent5dc261c352550dfaa99d900bf625e0efdcb469a0 (diff)
downloadsqlalchemy-0e857ffa32ebbb0886f2aaa2bf5a3f3d33545432.tar.gz
Added PGCidr type to postgres. Closes #1092
-rw-r--r--CHANGES2
-rw-r--r--lib/sqlalchemy/databases/postgres.py5
2 files changed, 7 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index 82f8aff41..b538d3277 100644
--- a/CHANGES
+++ b/CHANGES
@@ -49,6 +49,8 @@ CHANGES
- Repaired server_side_cursors to properly detect
text() clauses.
+ - Added PGCidr type. [ticket:1092]
+
- mysql
- Added 'CALL' to the list of SQL keywords which return
result rows.
diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py
index 0ab6dd8b4..d18fcf4c1 100644
--- a/lib/sqlalchemy/databases/postgres.py
+++ b/lib/sqlalchemy/databases/postgres.py
@@ -32,6 +32,10 @@ class PGInet(sqltypes.TypeEngine):
def get_col_spec(self):
return "INET"
+class PGCidr(sqltypes.TypeEngine):
+ def get_col_spec(self):
+ return "CIDR"
+
class PGMacAddr(sqltypes.TypeEngine):
def get_col_spec(self):
return "MACADDR"
@@ -200,6 +204,7 @@ ischema_names = {
'float' : PGFloat,
'real' : PGFloat,
'inet': PGInet,
+ 'cidr': PGCidr,
'macaddr': PGMacAddr,
'double precision' : PGFloat,
'timestamp' : PGDateTime,