Appadmin delete problem

31 views
Skip to first unread message

Robin Manoli

unread,
Dec 10, 2014, 4:02:58 AM12/10/14
to web...@googlegroups.com
Hey,
this happens when I try to delete a row from appadmin, or an sqlform:

Traceback (most recent call last):
  File "/web2py/gluon/restricted.py", line 224, in restricted
    exec ccode in environment
  File "/web2py/applications/myapp/controllers/appadmin.py", line 671, in <module>
  File "/web2py/gluon/globals.py", line 392, in <lambda>
    self._caller = lambda f: f()
  File "/web2py/applications/myapp/controllers/appadmin.py", line 343, in update
    if form.accepts(request.vars, session):
  File "/web2py/gluon/sqlhtml.py", line 1521, in accepts
    self.table._db(qry).delete()
  File "/web2py/gluon/dal.py", line 10760, in delete
    ret and [f(self) for f in table._after_delete]
TypeError: <lambda>() takes exactly 2 arguments (1 given)

Any idea how to fix it?

I'm currently using mysql, and the rocket server.

Anthony

unread,
Dec 10, 2014, 8:38:57 AM12/10/14
to web...@googlegroups.com
Have you defined any _after_delete functions for the table in question?

Robin Manoli

unread,
Dec 14, 2014, 5:01:54 AM12/14/14
to web...@googlegroups.com
Ah yes!
The _after_delete was defined the same way as _after_insert:
_after_delete: lambda fields, id:

so I had to remove the id, and change it to self:
_after_delete: lambda self:
Reply all
Reply to author
Forward
0 new messages