From: Mike Bayer Date: Sat, 17 Feb 2007 02:36:11 +0000 (+0000) Subject: added PGInet type [ticket:444] X-Git-Tag: rel_0_3_5~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=123498ee1fe869ac5c5630d20fbe871bf8232956;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git added PGInet type [ticket:444] --- diff --git a/CHANGES b/CHANGES index 05b9e49a19..1862260513 100644 --- a/CHANGES +++ b/CHANGES @@ -54,7 +54,7 @@ - postgres: - better reflection of sequences for alternate-schema Tables [ticket:442] - sequences on a non-pk column will properly fire off on INSERT - - added PGInterval type [ticket:460] + - added PGInterval type [ticket:460], PGInet type [ticket:444] - ext: - added distinct() method to SelectResults. generally should only make a difference when using count(). diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py index 24c250f7a1..b76aafc222 100644 --- a/lib/sqlalchemy/databases/postgres.py +++ b/lib/sqlalchemy/databases/postgres.py @@ -32,6 +32,10 @@ except: except: psycopg = None +class PGInet(sqltypes.TypeEngine): + def get_col_spec(self): + return "INET" + class PGNumeric(sqltypes.Numeric): def get_col_spec(self): if not self.precision: @@ -164,6 +168,7 @@ pg2_ischema_names = { 'numeric' : PGNumeric, 'float' : PGFloat, 'real' : PGFloat, + 'inet': PGInet, 'double precision' : PGFloat, 'timestamp' : PG2DateTime, 'timestamp with time zone' : PG2DateTime,