I solve this with this code
IS_UPPER(),IS_MATCH('([a-zA-Z]*[ ]*[á]*[é]*[í]*[ó]*[ú]*)
+',error_message='Solo se permite a-z, A-Z y espacios')the problem is that i insert Perú, in the database i see PERú, the ú is not upper it should appear Ú what can i do for this? On 1 oct, 19:53, Sophie <[email protected]> wrote: > For acute what can i do. I see examples for php '/&([aeioun])(acute| > tilde); > i dont find for python > > On 1 oct, 19:21, Yarko Tymciurak <[email protected]> wrote: > > > > > On Thu, Oct 1, 2009 at 5:45 PM, Sophie <[email protected]> wrote: > > > > IS_MATCH('[a-zA-Z]+',error_message='Only charaters allowed') > > > This reads: > > > any string of one or more of any combination of upper or lower case > > letters... > > > > This works but if i want to add spaces, for las name for example: De > > > La Rosa > > > How can i do this? > > > You can group regular expressions, e.g.: > > > ([A-Z][a-z]*[ ]*)+ > > > You can test the results with tools, e.g.http://www.pythonregex.com/ > > > > On 1 oct, 16:46, mdipierro <[email protected]> wrote: > > > > This: > > > > > requires=[IS_NOT_EMPTY('Please insert a country name'), > > > > IS_UPPER(), IS_NOT_IN_DB(db,'Country.nCountry','This country is > > > > already in the database')], > > > > > should already do what you asked as long as you do not have already > > > > data in the DB. > > > > > You can add one more validator instead > > > > IS_MATCH('[a-zA-Z]+',error_message='Only charaters allowed') > > > > > What about Cote' d'Ivoire? > > > > > On Oct 1, 4:11 pm, Sophie <[email protected]> wrote: > > > > > > Hi there my problem is when i validate myinput, i have this code in > > > > > the model > > > > > > db.define_table("Country", > > > > > Field("nCountry", "string", default=None, label="Name", > > > > > notnull=True, requires=[IS_NOT_EMPTY('Please insert a country name'), > > > > > IS_UPPER(), IS_NOT_IN_DB(db,'Country.nCountry','This country is > > > > > already in the database')], ondelete='CASCADE')) > > > > > > So when i start inserting data i have duplicate data like this: > > > > > Brazil, BRazil, BRAzil, braZil. > > > > > > This is the same country, but is written in different ways. There is a > > > > > way to validate this? > > > > > > The other problem i have is that i can insert Br4zil, but i want it to > > > > > receive only alphabetical inputs. > > > > > > Well thats all thanks a lot. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

