On Thursday, July 16, 2015 at 4:33:32 PM UTC-7, Alex wrote: > > > the error messages indicates a different error. A failed Foreign Key > constraint happens when you set an invalid id for a FK field. Check your > references, from the snippet you posted only color is a foreign key so > maybe this field value is invalid. > > His lambda refers to db.supplier.pricecoefficient selected by r.suppliercode; could those be the source of the Foreign Key exception?
Am Freitag, 17. Juli 2015 00:38:42 UTC+2 schrieb greenpoise: >> >> Alex, >> >> Just noticed that it is not the calculation. The error lies in the Size 1 >> & Size 2 of my db. These values could be decimal. So let me post this again. >> >> >> db: >> Field('size1'), >> Field('size2'), >> Field('color','reference color'), >> >> >> error: >> >> Traceback (most recent call last): >> File "Applications/web2py/gluon/restricted.py", line 227, in restricted >> exec ccode in environment >> File >> "Applications/web2py/applications/MosaicCatalogBuilder/controllers/appadmin.py" >> >> <http://127.0.0.1:8000/admin/default/edit/MosaicCatalogBuilder/controllers/appadmin.py>, >> line 463, in <module> >> File "Applications/web2py/gluon/globals.py", line 412, in <lambda> >> self._caller = lambda f: f() >> File >> "Applications/web2py/applications/MosaicCatalogBuilder/controllers/appadmin.py" >> >> <http://127.0.0.1:8000/admin/default/edit/MosaicCatalogBuilder/controllers/appadmin.py>, >> line 299, in update >> if form.accepts(request.vars, session): >> File "Applications/web2py/gluon/sqlhtml.py", line 1686, in accepts >> self.id_field_name]).update(**fields) >> File "Applications/web2py/gluon/packages/dal/pydal/objects.py", line 2020, >> in update >> ret = db._adapter.update("%s" % table._tablename,self.query,fields) >> File "Applications/web2py/gluon/packages/dal/pydal/adapters/base.py", line >> 996, in update >> raise e >> IntegrityError: FOREIGN KEY constraint failed >> >> >> Thanks! >> >> >> On Thursday, July 16, 2015 at 3:30:24 PM UTC-7, Alex wrote: >>> >>> Posting the error information would probably help. Leaving the type >>> blank sets 'string' as default. According to the documentation there is >>> only a type 'double' but no type 'float'. What's the data type of your >>> column in the db? >>> >>> Alex >>> >> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.