Update of /cvsroot/sqlobject/SQLObject/SQLObject/include
In directory sc8-pr-cvs1:/tmp/cvs-serv2752/SQLObject/include
Modified Files:
Validator.py
Log Message:
Mostly whitespace and a fix for postgreSQLCreate
Index: Validator.py
===================================================================
RCS file: /cvsroot/sqlobject/SQLObject/SQLObject/include/Validator.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Validator.py 7 Sep 2003 22:35:09 -0000 1.1
--- Validator.py 24 Sep 2003 12:18:15 -0000 1.2
***************
*** 1,5 ****
## FormEncode, a Form processor
## Copyright (C) 2003, Ian Bicking <ia...@co...>
! ##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
--- 1,5 ----
## FormEncode, a Form processor
## Copyright (C) 2003, Ian Bicking <ia...@co...>
! ##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
***************
*** 71,75 ****
obj = All(*obj)
return obj
!
def _validateToSomething(obj, value, state, finisher):
validator = getValidator(obj)
--- 71,75 ----
obj = All(*obj)
return obj
!
def _validateToSomething(obj, value, state, finisher):
validator = getValidator(obj)
***************
*** 113,117 ****
def message(self, name, default):
! if not self.messages:
return default
return self.messages.get(name, default)
--- 113,117 ----
def message(self, name, default):
! if not self.messages:
return default
return self.messages.get(name, default)
***************
*** 150,154 ****
* .sqlToPython(value, state):
* .pythonToSQL(value, state):
!
Validators should have no internal state besides the
values given at instantiation. They should be reusable and
--- 150,154 ----
* .sqlToPython(value, state):
* .pythonToSQL(value, state):
!
Validators should have no internal state besides the
values given at instantiation. They should be reusable and
***************
*** 293,297 ****
an integer, and then check if each integer is 1, 2, or 3.
"""
!
def attemptConvert(self, value, state, validate):
newList = []
--- 293,297 ----
an integer, and then check if each integer is 1, 2, or 3.
"""
!
def attemptConvert(self, value, state, validate):
newList = []
***************
*** 377,381 ****
except Exception, e:
raise InvalidField(str(e), value, state)
! return result
class Constant(FancyValidator):
--- 377,381 ----
except Exception, e:
raise InvalidField(str(e), value, state)
! return result
class Constant(FancyValidator):
***************
*** 538,542 ****
return i
raise InvalidField("Item %s was not found in the list"
! % repr(value), value, state)
class DateValidator(FancyValidator):
--- 538,542 ----
return i
raise InvalidField("Item %s was not found in the list"
! % repr(value), value, state)
class DateValidator(FancyValidator):
***************
*** 582,586 ****
"""
Converts things to string, but treats empty things as the empty
! string.
"""
--- 582,586 ----
"""
Converts things to string, but treats empty things as the empty
! string.
"""
***************
*** 705,709 ****
self.message('invalid', 'That is not a valid state code'),
value, state)
!
def _toPython(self, value, state):
return string.strip(string.upper(value))
--- 705,709 ----
self.message('invalid', 'That is not a valid state code'),
value, state)
!
def _toPython(self, value, state):
return string.strip(string.upper(value))
***************
*** 803,807 ****
except DateTime.RangeError, v:
raise InvalidField(self.message('invalidDay', 'That is not a valid day') + '(%s)' % v, value, state)
!
def makeMonth(self, value):
try:
--- 803,807 ----
except DateTime.RangeError, v:
raise InvalidField(self.message('invalidDay', 'That is not a valid day') + '(%s)' % v, value, state)
!
def makeMonth(self, value):
try:
***************
*** 844,848 ****
# @@ ib: double-check, improve
return value.strftime("%m/%d/%Y")
!
def unconvertMonth(self, value, state):
# @@ ib: double-check, improve
--- 844,848 ----
# @@ ib: double-check, improve
return value.strftime("%m/%d/%Y")
!
def unconvertMonth(self, value, state):
# @@ ib: double-check, improve
***************
*** 879,883 ****
"""
A FormValidator is something that can be chained with a
! Schema. Unlike normal chaining the FormValidator can
validate forms that aren't entirely valid.
--- 879,883 ----
"""
A FormValidator is something that can be chained with a
! Schema. Unlike normal chaining the FormValidator can
validate forms that aren't entirely valid.
***************
*** 973,977 ****
for name, value in errorList]),
fieldDict, state, errorDict=errors)
!
def _validateReturn(self, fieldDict, state):
ccType = string.lower(string.strip(fieldDict[self._ccTypeField]))
--- 973,977 ----
for name, value in errorList]),
fieldDict, state, errorDict=errors)
!
def _validateReturn(self, fieldDict, state):
ccType = string.lower(string.strip(fieldDict[self._ccTypeField]))
|