Instead of an edit form you see the following exception trace in the logs:
File "/home/cfhowes/clients/pump/source/web2py/gluon/validators.py", line 414, in build_set
orderby = self.orderby or reduce(lambda a,b:a|b,(f for f in fields if not f.name=='id'))
TypeError: reduce() of empty sequence with no initial value
If you edit validators.py to replace line 414 with:
f_list = [f for f in fields if not f.name=='id']
orderby = self.orderby or (reduce(lambda a,b:a|b,f_list) if len(f_list) > 0 else None)
it works again. This did work in previous versions of web2py (pre-DAL upgrade was the last time i tested it)
From cfho...@cfhowes.com on January 05, 2011 20:29:46
What steps will reproduce the problem? 1. get web2py 1.91.6, run on GAE dev server
db.define_table('allergen', Field('allergen', length=500, notnull=True, unique=True, requires=IS_NOT_IN_DB(db, 'allergen.allergen')), migrate=migrate) db.define_table('test', Field('allergens', 'list:reference allergen'), )
Instead of an edit form you see the following exception trace in the logs:
File "/home/cfhowes/clients/pump/source/web2py/gluon/validators.py", line 414, in build_set orderby = self.orderby or reduce(lambda a,b:a|b,(f for f in fields if not f.name=='id')) TypeError: reduce() of empty sequence with no initial value
If you edit validators.py to replace line 414 with:
it works again. This did work in previous versions of web2py (pre-DAL upgrade was the last time i tested it)
Original issue: http://code.google.com/p/web2py/issues/detail?id=147