It is said earlier in the 'grid' documentation that onvalidation, oncreate, 
onupdate, and ondelete are all callbacks, as such, callbacks are functions, 
not dictionaries. Callbacks are functions that are passed to other 
functions. 

onvalidation, oncreate, onupdate and ondelete are callback functions. All 
but ondelete take a form object as input

On Tuesday, January 15, 2013 2:24:56 AM UTC-7, Kostas M wrote:
>
> OK fine, then why, in continuation of the above example,
>
> def test():
>     grid = SQLFORM.smartgrid(db.person, linked_tables=['dog'], ondelete=
> dict( dog=ondelete_test ))
>     return dict(grid=grid)
>
> def ondelete_test(table_involved, id_of_the_deleted_record):
>     print table_involved
>     print id_of_the_deleted_record
>
>
> ondelete=dict( dog=ondelete_test ) doesn't fire  (nothing is printed, one 
> dog row is removed but on refresh is back), 
> while 
> ondelete=ondelete_test   does fire, prints the values, and removes 
> permantly the rows
>
> ondelete doesn't belong to both grid and smartgrid? Or this is a bug?
>
>
> On Tuesday, January 15, 2013 1:30:12 AM UTC, Massimo Di Pierro wrote:
>>
>> The rule is simple. All options that belong to both grid and smartgrid 
>> (except args) can take a dictionary in smartgrid. If a dictionary is 
>> passed, the value is passed the grid, in correspondance to a key == 
>> tablename.
>>
>>
>>

-- 



Reply via email to