Hi Massimo,
with version 1472 a bug in sql.py is introduced:
File "/Applications/cherokee.app/Contents/MacOS/web2py/gluon/
sql.py", line 1234, in define_table
t = self[tablename] = Table(self, tablename, *fields)
File "/Applications/cherokee.app/Contents/MacOS/web2py/gluon/
sql.py", line 1506, in __init__
field.requires = sqlhtml_validators(field)
File "/Applications/cherokee.app/Contents/MacOS/web2py/gluon/
sql.py", line 467, in sqlhtml_validators
requires[-1]=validators.IS_EMPTY_OR(requires[-1])
IndexError: list index out of range
I have reverted to 1471 and all my models works again.
Some of my apps are a little bit older, should I rewrite the models?
proof=SQLDB("sqlite://proof.db")
proof.define_table('reference',
SQLField('name'),
SQLField('l', 'double'),
SQLField('a', 'double'),
SQLField('b', 'double'),
SQLField('opacity', 'integer', default=0),
SQLField('preview'))
proof.define_table('file',
SQLField('name', length=64),
SQLField('kind'),
SQLField('data','upload'))
proof.define_table('match',
SQLField('name'),
SQLField('press', proof.file),
SQLField('proof', proof.file),
SQLField('intent'),
SQLField('spotcolor', proof.file),
SQLField('optimize', proof.file),
SQLField('fmcal', proof.file),
SQLField('cal', proof.file),
SQLField('bump', proof.file),
SQLField('keep_black', 'boolean'),
SQLField('proofer'),
SQLField('pos', 'integer'))
proof.define_table('color',
SQLField('name'),
SQLField('reference', proof.reference),
SQLField('match', proof.match),
SQLField('c', 'integer', default=0),
SQLField('m', 'integer', default=0),
SQLField('y', 'integer', default=0),
SQLField('k', 'integer', default=0),
SQLField('opacity', 'integer', default=0),
SQLField('preview'))
proof.reference.name.requires = [IS_NOT_EMPTY("Muss angeben
werden!"), IS_NOT_IN_DB(proof, "reference.name", "Name bereits
vorhanden!")]
proof.reference.l.requires = IS_FLOAT_IN_RANGE(0,101,"Muss imm
Bereich von 0-100 sein!")
proof.reference.a.requires = IS_FLOAT_IN_RANGE(-255,255,"Muss imm
Bereich von -255 bis 255 sein!")
proof.reference.b.requires = IS_FLOAT_IN_RANGE(-255,255,"Muss imm
Bereich von -255 bis 255 sein!")
proof.reference.opacity.requires = IS_INT_IN_RANGE(0,101,"Muss imm
Bereich von 0-100 sein!")
proof.file.name.requires = IS_NOT_EMPTY("Eine Datei muss
ausgewählt sein!")
proof.file.kind.requires = IS_IN_SET(("profile", "cal", "bump"))
proof.match.press.requires = IS_IN_DB(proof(proof.file.kind ==
"profile"), "file.id", "%(name)s")
proof.match.proof.requires = IS_IN_DB(proof(proof.file.kind ==
"profile"), "file.id", "%(name)s")
proof.match.spotcolor.requires = IS_IN_DB(proof(proof.file.kind ==
"profile"), "file.id", "%(name)s")
proof.match.optimize.requires = IS_NULL_OR(IS_IN_DB(proof
(proof.file.kind == "profile"), "file.id", "%(name)s"))
proof.match.fmcal.requires = IS_IN_DB(proof(proof.file.kind ==
"cal"), "file.id", "%(name)s")
proof.match.cal.requires = IS_IN_DB(proof(proof.file.kind ==
"cal"), "file.id", "%(name)s")
proof.match.bump.requires = IS_IN_DB(proof(proof.file.kind ==
"bump"), "file.id", "%(name)s")
proof.match.intent.requires = IS_IN_SET(("absolute", "relative"))
proof.match.proofer.requires = IS_IN_SET(("Epson9900", "Epson9600"))
proof.color.name.requires = IS_NOT_EMPTY("Muss angeben werden!")
proof.color.reference.requires = IS_NULL_OR
(proof.color.reference.requires)
proof.color.match.requires = IS_IN_DB(proof, "match.id", "%(name)
s",orderby=proof.match.pos)
proof.color.c.requires = IS_INT_IN_RANGE(0,101,"Muss im
Bereich von 0-100 sein!")
proof.color.m.requires = IS_INT_IN_RANGE(0,101,"Muss im
Bereich von 0-100 sein!")
proof.color.y.requires = IS_INT_IN_RANGE(0,101,"Muss im
Bereich von 0-100 sein!")
proof.color.k.requires = IS_INT_IN_RANGE(0,101,"Muss im
Bereich von 0-100 sein!")
proof.color.opacity.requires = IS_INT_IN_RANGE(0,101,"Muss imm
Bereich von 0-100 sein!")
Martin
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.