Create an edit method in your controller. Before your call to form.accepts(), stash the old parent id somewhere. You can put it in the session or in a hidden field on the form. The session is better in my opinion because you don't need to validate it like you must validate something that comes in the response.
After form.accepts(), compare form.vars.parent_id with the value you stored in the session. If they are different, create your log entry. There may be better ways to do this, but I have used this method successfully. On Nov 3, 8:22 am, Vinicius Assef <[email protected]> wrote: > Hi guys. > > I have this model: > > db.define_table('parent', > Field('name', 'string'), > format='%(name)') > db.define_table('child', > Field('name', 'string'), > Field('relation', 'string'), > Field('parent_id', db.parent), > format='%(name)s %(relation)s') > > I need to develop a feature to change the child's parent and store > this operation in a log table. > > I thought about showing a SQLFORM with all these fields and an extra > one, created dynamically, using the same IS_IN_DB() validation like > the db.child.parent_id. > But, how can I do this? > > Is there another simpler way to achieve my goal? > > Thanks in advance. > > -- > Vinicius Assef.

