Re: Validator across fields

2006-01-07 Thread hugo
>Have you looked at django.core.validators? There's one in there called >RequiredIfOtherFieldNotGiven that might do what you want. You'd want >to make both fields blank=True and add that validator to >validator_list Keep in mind that cross-field-validators only work on the main record, not on pos

Re: Validator across fields

2006-01-06 Thread Joseph Kocherhans
On 1/6/06, Kevin <[EMAIL PROTECTED]> wrote: > > The main issue is, I'm trying to add a constraint that the user enter > EITHER a phone number OR an email. So I thought I could write a custom > validator that took the all_data param and did the check. Have you looked at django.core.validators? Th

Validator across fields

2006-01-06 Thread Kevin
I'm sure this has been asked before, but googling didn't turn up a solution. I have the following class: class ContactInfo(meta.Model): name = meta.CharField() phone = meta.PhoneNumberField(blank=True) email = meta.EmailField(blank=True) And I'm trying to present a form to the user