Hi

I have tested the NO ACTION and it gives some king of solution . I have 
defined the following simple model
db.define_table('table_parent',Field('parent_name'))
db.define_table('table_child',Field('child_name'),
Field('parentid', 'reference table_parent',ondelete='NO 
ACTION',required=True ))

with smart grid , on attempt to delete from parent table if there are a 
child reference it display an error messgae 
"An error occurred , Please reload the Page "  . That means the Form 
continue to function without throwing a ticket .
But , Still it will be nice if a more significant message would be 
displayed .

Thks
Rafi


On Monday, December 4, 2017 at 5:01:38 PM UTC+2, rafi farchi wrote:
>
> Hi
> How i can define a requiers rule so that a row in parent table can be 
> deleted only if it does not have any reference . if an attempt to delete 
> and there are rows in child tables then the delete is blocked and a message 
> pop up (same as in m/s access)- you can not delete it is referenced by 
> child tables ...

-- 
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.

Reply via email to