Hi Marco, if you mean at db level, it depends on your db engine. To my knowledge, in Sqlite you can not get foreign key constraints ("on delete=cascade" or similar is not effective) but you have to use Triggers to achieve the same result. Foreign keys constraints though can be enforced in most of other rdbms. Of course sort of referential integrity can be assured via software checking in every table which has a reference to the record you want to delete.
carlo On 9 Giu, 13:51, Marco Prosperi <marcoprosperi...@gmail.com> wrote: > hi all, is there a validator or an easy way to prevent a user to > delete a record if there are other records referencing it? Just to > make an example: consider the 'images' application in cookbook2.pdf. I > would like that the user cannot delete an image if there are comments > referred to it (it would be useful to get a warning message specifying > that the user has to delete the comments first) > > thanks in advance, > > Marco --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---