Package orm2 :: Package adapters :: Package gadfly :: Module datatypes
[hide private]
[frames] | no frames]

Source Code for Module orm2.adapters.gadfly.datatypes

 1  #!/usr/bin/env python 
 2  # -*- coding: iso-8859-1 -*- 
 3   
 4  ##  This file is part of orm, The Object Relational Membrane Version 2. 
 5  ## 
 6  ##  Copyright 2002-2006 by Diedrich Vorberg <diedrich@tux4web.de> 
 7  ## 
 8  ##  All Rights Reserved 
 9  ## 
10  ##  For more Information on orm see the README file. 
11  ## 
12  ##  This program is free software; you can redistribute it and/or modify 
13  ##  it under the terms of the GNU General Public License as published by 
14  ##  the Free Software Foundation; either version 2 of the License, or 
15  ##  (at your option) any later version. 
16  ## 
17  ##  This program is distributed in the hope that it will be useful, 
18  ##  but WITHOUT ANY WARRANTY; without even the implied warranty of 
19  ##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
20  ##  GNU General Public License for more details. 
21  ## 
22  ##  You should have received a copy of the GNU General Public License 
23  ##  along with this program; if not, write to the Free Software 
24  ##  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
25  ## 
26  ##  I have added a copy of the GPL in the file gpl.txt. 
27   
28   
29  # Changelog 
30  # --------- 
31  # 
32  # $Log: datatypes.py,v $ 
33  # Revision 1.1  2006/09/04 15:54:20  diedrich 
34  # Gadfly now manages Unicode using sql.direct_literal. 
35  # 
36  # 
37  # 
38   
39   
40  __docformat__ = "epytext en" 
41   
42  """ 
43  This module implements datatype classes that are specific to PostgreSQL. 
44  """ 
45   
46  # Python 
47  import sys 
48  import string 
49  from types import * 
50   
51  # orm 
52  from orm2 import datatypes 
53  from orm2 import sql 
54  from orm2.util.fixedpoint import FixedPoint 
55   
56 -class Unicode(datatypes.Unicode):
57 """ 58 The gadfly adapter defines its own Unicode type, because gadfly can't 59 work with binary strings encoded as literals. This class uses 60 sql.dicect_literal to pass the encoded unicode string to gadfly using 61 the cursor.execute() method's '?' syntax. 62 """ 63 python_class = unicode 64 sql_literal_class = sql.direct_literal
65