I'm not sure what the "like operator" has to do with this? I guess what I'm talking about is using a validator to actually do the work of an "autocompleted normalized field". Much like the password encryption validator.. or is_lower works... those validators actually change the value of the field before storing it. what I'm looking for is a way to have a validator that will do an "IS_LOWER" on a different field of the same record.... which would in essence BE a "hidden autocomputed normalized field"
is there already a "hidden autocomputed normalized field" functionality in Web2py? could you point me towards it? right now I have written separate code that computes the normalized/ canonical value and puts it in the other field... but I'd rather not have this extra code at the app level... would be better to have it in the model level so that it doesn't get overlooked by accident Thanks! -Nick Franceschina On Jun 25, 5:38 pm, mdipierro <[email protected]> wrote: > While it sould be easy to write such validator using the like > operator, it would not be portable because it would not work on gae > and would be slow in general. The preferred way is to use a hidden > autocomputed normalized field. > > On Jun 25, 10:54 am, NickFranceschina <[email protected]> > wrote: > > > > > Massimo, > > > just realized that GQL does not allow for LOWER() or UPPER()... thus > > cannot do case-insensitive searches. the generally suggested solution > > is to create another field and store the canonical form of the string > > you're trying to search > > > example: > > person.name = "Nick Franceschina" > > person.canonical = "nick franceschina" > > > would be nice to have a validator that could do this automatically... > > it would work like the IS_LOWER() validator, but would look into > > another field for the data... something like: > > Field('canonical', 'string', requires=CANONICAL('person.name')) > > > then I just put my data into "name" as I always do, and wouldn't have > > to write special code to do the canonical field... > > > is there anything like this now, and I'm not seeing it? i'll keep > > looking... > > > Thanks, > > -Nick Franceschina

