It doesn't seem like anyone else has run into this particular issue before. I have an SQLFORM grid that is allowing my staff members on our website to add links to their profile upon the crew page. An example is mine at https://www.nightwave.me/crew?member=VinylDarkscratch However, I found out that SQLFORM.grid does not take a *fields* parameter like normal SQLFORM does, and as such staff members have access to edit fields they should not be able to, such as the user ID. So, I attempted to set a default for the fields, in the controller function, to be the value that I'd like it to be, however I had gotten the following error:
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. Traceback (most recent call last): File "/home/vinyldarkscratch/nightwave/gluon/restricted.py", line 227, in restricted exec ccode in environment File "/home/vinyldarkscratch/nightwave/applications/nightwave/controllers/default.py" <https://www.nightwave.me/admin/edit/nightwave/controllers/default.py>, line 294, in <module> File "/home/vinyldarkscratch/nightwave/gluon/globals.py", line 412, in <lambda> self._caller = lambda f: f() File "/home/vinyldarkscratch/nightwave/gluon/tools.py", line 3774, in f return action(*a, **b) File "/home/vinyldarkscratch/nightwave/applications/nightwave/controllers/default.py" <https://www.nightwave.me/admin/edit/nightwave/controllers/default.py>, line 68, in submit_bio_links linkform = SQLFORM.grid((db.user_links.user_id == auth.user.id)) File "/home/vinyldarkscratch/nightwave/gluon/sqlhtml.py", line 2264, in grid onsuccess=oncreate) File "/home/vinyldarkscratch/nightwave/gluon/html.py", line 2301, in process self.validate(**kwargs) File "/home/vinyldarkscratch/nightwave/gluon/html.py", line 2238, in validate if self.accepts(**kwargs): File "/home/vinyldarkscratch/nightwave/gluon/sqlhtml.py", line 1711, in accepts self.vars.id = self.table.insert(**fields) File "/home/vinyldarkscratch/nightwave/gluon/packages/dal/pydal/objects.py", line 712, in insert ret = self._db._adapter.insert(self, self._listify(fields)) File "/home/vinyldarkscratch/nightwave/gluon/packages/dal/pydal/objects.py", line 658, in _listify 'Table: missing required field: %s' % name) RuntimeError: Table: missing required field: user_id Any suggestions on how to set a field's value in an SQLFORM.grid after submission? -- 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.