On Nov 16, 3:21 pm, Sophie <kfarron...@gmail.com> wrote: > Other validation i have problem is inserting states > db.define_table("State", > Field("idCountry", db.Country, label="Country"), > Field("nState", "string", default=None, label="State", notnull=True, > ondelete='CASCADE')) > I cant put is_not_in_db() in nState, because > I have a state named Alberta in canada, but maybe is there a state > Alberta in other country if i put this, i cant insert the state > alberta in both countries. But if i dont do this i can insert Alberta > in Canada a lot of times. > so, is there a way to validate both fields in the model?
I think you need a custom validator class. This post may be helpful: http://thread.gmane.org/gmane.comp.python.web2py/2155 F --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" 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 -~----------~----~----~----~------~----~------~--~---