Good catch but this this is fixed in trunk already. ;-) Will repost 1.60 soon.
Massimo On Apr 7, 2:09 am, Guido Kollerie <gu...@kollerie.com> wrote: > Hi, > > Accidentally came across the following scenario which I suspect to have > exposed a bug in Web2py. > > While working on an application I noticed I had identical values > occurring in a particular column. E.g. given: > > db = SQLDB('sqlite://storage.db') > db.define_table('person',SQLField('name')) > > I found I had something like below in my database: > > person.id person.name > 1 Guido > 2 Jort > 3 Guido > > I realised 'person.name' should have been unique. Hence I added to > following to my model definition: > > db.person.name.requires=IS_NOT_IN_DB(db, 'person.name') > > Then I set out to remove the non unique entries ('Guido' in this case) > by hand using appadmin. Clicking on 'db.person' in de admin showed the > table above. Next I clicked on 'person.id' 3, checked the 'Check to > delete' checkbox and clicked 'submit'. > > The newly added validator was executed as I got the following error: > > 'value already in database!' > > I would have expected this validator to be *only* executed on inserts > and updates, though not on deletes. Is this a bug in Web2py? > > -- > Guido --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---