Christian Schneider wrote:
> On 4/25/06, Michael Radziej <mir noris.de> wrote:
>>
>> Christian Schneider wrote:
>>> Michael,
>>>
>>> I'm still using a generic view. I played with
some custom functions
>> before
>>> and they were called so I'd hoped that it
would work with the validator
>>> objects as well.
>> I looked in the source. Aha! First parameter to
RequiredIfOtherField is
>> the *name* of the field (a string, not a field).
>>
>> Please try and report ...
>
>
> nothing's happening, :-(
>
> Even if it worked would validation stop if the
referenced field didn't have
> the required value? That is: Field 1 is required when
field 2 has value "x"
> and field 2's value is "y". Field 1 is
blank which it should be allowed to
> but would validation stop after evaluating the
RequiredIfOtherField
> validator runs (if it even runs first)?
I don't know what you mean with "stop". I think
each validator will be
executed, but they will take into account whether
record_type has the
right value.
Anyway, I personally give up :-(
You can try to find out what's happening:
- create your own validator that always raises a
ValidationError (see in
the sources for core.validators to see how)
- add this to your validator list
- do you get a validation message?
- if not, do something like "raise Blablabla"
which should immediately
result in a backtrace when called. What's happening now?
- else, change the source of core.validators in Django;
raise
Blablabla in the __call__() method. Do you get the error
message?
You get the picture ...
Hope that helps a little bit.
I created a ticket to add documentation for this module
(#1680)
Michael
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-users googlegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribe googlegroups.com
For more options, visit this group at http://gr
oups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---
|