Update of /cvsroot/modeling/ProjectModeling/Modeling
In directory sc8-pr-cvs1:/tmp/cvs-serv31980
Modified Files:
CHANGES ModelValidation.py
Log Message:
Fixed: ModelValidation does not issue an error anymore when a model
contains a CHAR/VARCHAR field with no width set, as long as the underlying
adaptor supports it (varchar w/o width are valid for: Postgresql, SQLite),
as Ernesto Revilla suggested it.
Index: CHANGES
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/CHANGES,v
retrieving revision 1.112
retrieving revision 1.113
diff -C2 -d -r1.112 -r1.113
*** CHANGES 19 Jun 2003 14:19:02 -0000 1.112
--- CHANGES 24 Jun 2003 08:51:10 -0000 1.113
***************
*** 8,11 ****
--- 8,16 ----
--------------------------------------------------------
+ * Fixed: ModelValidation does not issue an error anymore when a model
+ contains a CHAR/VARCHAR field with no width set, as long as the underlying
+ adaptor supports it (varchar w/o width are valid for: Postgresql, SQLite),
+ as Ernesto Revilla suggested it.
+
* Fixed bug #757181: under python2.2 AccessArrayFaultHandler was triggered
every time the array is accessed, instead of being fired only once.
Index: ModelValidation.py
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/ModelValidation.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** ModelValidation.py 17 Jun 2003 17:01:30 -0000 1.8
--- ModelValidation.py 24 Jun 2003 08:51:10 -0000 1.9
***************
*** 42,45 ****
--- 42,46 ----
WARNING=2
INFO=3
+ DEBUG=4
MSGS_FOR_LEVELS={ NOT_SUPPORTED: 'Not supported feature(s)',
***************
*** 47,50 ****
--- 48,52 ----
WARNING: 'Warning(s)',
INFO: 'Info',
+ DEBUG: 'Debug',
}
LEVELS=tuple(MSGS_FOR_LEVELS.keys())
***************
*** 62,76 ****
object -- the object causing the error
! level -- valid levels are INFO, WARNING, ERROR, NOT_SUPPORTED, defined
! by the module
msg -- informational message
! ignore_levels --
"""
# Ignore levels
if not ignore_levels:
! self._ignored_levels=()
else:
if type(ignore_levels) not in (type(()), type([])):
--- 64,78 ----
object -- the object causing the error
! level -- valid levels are DEBUG, INFO, WARNING, ERROR, NOT_SUPPORTED,
! defined by the module
msg -- informational message
! ignore_levels -- list of level to ignore. Default is (DEBUG,)
"""
# Ignore levels
if not ignore_levels:
! self._ignored_levels=(DEBUG,)
else:
if type(ignore_levels) not in (type(()), type([])):
***************
*** 280,288 ****
errors.aggregateError('Entity %s'%entity.name(), WARNING, msgs)
! # INFO
msgs=[]
if not entity.typeName(): msgs.append('typeName is not defined')
if msgs:
! errors.aggregateError('Entity %s'%entity.name(), INFO, msgs)
--- 282,290 ----
errors.aggregateError('Entity %s'%entity.name(), WARNING, msgs)
! # DEBUG
msgs=[]
if not entity.typeName(): msgs.append('typeName is not defined')
if msgs:
! errors.aggregateError('Entity %s'%entity.name(), DEBUG, msgs)
***************
*** 334,337 ****
--- 336,340 ----
else:
concreteAdaptor=adaptorForModel(attribute.entity().model())
+ concreteAdaptorName=attribute.entity().model().adaptorName()
if not concreteAdaptor:
errors.aggregateError('Attribute %s.%s'%(attribute.entity().name(),
***************
*** 351,356 ****
msgs.append("NUMERIC type requires both 'precision' AND 'scale'")
elif extType in ('varchar', 'char'):
! if not attribute.width():
! msgs.append("VARCHAR type requires 'width' to be set") ## really??
elif extType in ('integer',):
if attribute.width() or attribute.width() or attribute.precision():
--- 354,360 ----
msgs.append("NUMERIC type requires both 'precision' AND 'scale'")
elif extType in ('varchar', 'char'):
! if not attribute.width() and \
! concreteAdaptorName not in ('Postgresql', 'SQLite'):
! msgs.append("CHAR/VARCHAR type requires 'width' to be set")
elif extType in ('integer',):
if attribute.width() or attribute.width() or attribute.precision():
***************
*** 367,371 ****
attribute.name()),
ERROR, msgs)
!
##
## Relationship
--- 371,375 ----
attribute.name()),
ERROR, msgs)
!
##
## Relationship
|