1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89 """
90 orm2 comes with a whole bunch of exception classes, collected in this module.
91 """
92
94 """
95 Base class for all of orm's exceptions
96 """
97
99 """
100 Something inside orm has gone wrong.
101 """
102
104 """
105 This exception indicates a syntax error in a connection string
106 """
107
109 """
110 Er... someone used an dbproperty that doesn't exist
111 """
112
114 """
115 This error is raised if a class does not have a primary key
116 (__primary_key__ == None) but some function requires a primary key.
117 """
118
120 """
121 To perform the requested operation, the object must have been stored
122 in the database.
123 """
124
126 """
127 Relationships may require dbobjects not to have been inserted into
128 the database prior to handling them. Also, you can't insert an object
129 into a table with a AUTO_INCREMENT column (or simmilar), that has the
130 corresponding attribute set already.
131 """
132
134 """
135 This exception is raised if a dbobj wants to be inserted that has
136 none of its attributes set. If you want an empty tuple to be
137 inserted to the database (to be filled with default values by the
138 backend, for instance) you have to set at least one of the
139 db-attributes to None.
140 """
141
143 """
144 This exception is raised when the select after insert mechanism is
145 invoked on an object of which the primary key is not known and cannot
146 be determined through the backend.
147 """
148
150 """
151 The backend had something to complain
152 """
153
154
156 """
157 Most datatypes need to be part of the class definition and cannot
158 be added later.
159 """
160
162 """
163 Raised by dbobject.__dbproperty__.
164 """
165
167 """
168 Raised if some function expects a single column primary key but a
169 multi column primary key is provided.
170 """
171
173 """
174 Raised if a key is not set or not set completely (that is, all of
175 its columns)
176 """
177
179 """
180 Raised if a foreign key attribute or set of attributes doesn't match
181 the attributes in the other dbclass.
182 """
183
185 """
186 Parentclass for all those exceptions raised by validators. Those
187 exceptions must always contain the dbobj, dbproperty and value
188 that caused the exception along with a plausible error message(! ;-)
189 This is ment to aid debugging and the creation of even more specific
190 error message than a generic validator could contain. (The idea is that
191 the message stored in the exception is an error for the programmer,
192 the error message for the user will be created from those values).
193 """
194 - def __init__(self, message, dbobj, dbproperty, value):
195 """
196 @param message: String(!) error message that goes into the regular
197 exception object. This is intended for programmers (see above) and
198 thus should be generic and in English.
199 @param dbobj: The dbobject whoes property was supposed to be set
200 @param dbproperty: The actual dbproperty that was supposed to be set
201 @param value: A Python object (as opposed to a repr()) of the value
202 the dbproperty was supposed to be set to
203 """
204 ORMException.__init__(self, message)
205 self.dbobj = dbobj
206 self.dbproperty = dbproperty
207 self.value = value
208
209
211 """
212 Raised by the not_null_validator
213 """
214
216 """
217 Raised by the not_empty_validator
218 """
219
221 """
222 Raised by range_check_validator
223 """
224
226 """
227 Raised by length_validator
228 """
229
231 - def __init__(self, msg, dbobj, dbproperty, re, value):
232 """
233 @param re: The regular expression which has not been matched.
234 """
235 ValidatorException.__init__(self, msg, dbobj, dbproperty, value)
236 self.re = re
237
239 - def __init__(self, msg, dbobj, dbproperty, value, format):
240 """
241 @param format: Date format string as for strftime()/strptime()
242 """
243 ValidatorException.__init__(self, msg, dbobj, dbproperty, value)
244 self.format = format
245
247 pass
248