Home | Trees | Indices | Help |
|
---|
|
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.4 2007/12/30 00:58:25 diedrich 34 # Added binary literal. 35 # 36 # Revision 1.3 2006/05/13 17:23:41 diedrich 37 # Massive docstring update. 38 # 39 # Revision 1.2 2006/05/10 21:55:41 diedrich 40 # Changed default for validators parameter to () rather than None 41 # 42 # Revision 1.1 2006/05/02 13:32:01 diedrich 43 # Ported mysql adapter from orm v.1 44 # 45 # 46 # 47 # 48 49 """ 50 This module implements datatype classes that are specific to MySQL 51 """ 52 53 # Python 54 import sys 55 from types import * 56 from string import * 57 58 # orm 59 from orm2.datatypes import * 6062 """ 63 This datatype is for INTEGER columns using MySQL's AUTO_INCREMENT 64 functionality. They usually serve as primary keys. 65 """ 66 7191 92 93 102 106 107 108 blob = binary 109 blob_literal = binary_literal 110 111 112 113 # Local variables: 114 # mode: python 115 # ispell-local-dictionary: "english" 116 # End: 11773 # When we've already got a value, we can't be inserted again. 74 if self.isset(dbobj): 75 tpl = ( self.attribute_name, 76 self.dbclass.__name__, 77 dbobj.__primary_key_column__(), 78 dbobj.__primary_key_literal__(), ) 79 80 raise ObjectAlreadyInserted( 81 "Attribute %s of '%s' (%s=%s) has already been set." % tpl) 82 83 return True8486 if self.isset(dbobj): 87 raise ORMException( "A auto_increment property is not mutable, "+\ 88 "once it is on object creation" ) 89 else: 90 integer.__set__(self, dbobj, value)
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0alpha3 on Wed Feb 20 18:17:35 2008 | http://epydoc.sourceforge.net |