Re: [dfv] Altering data in D::FV::Results
Status: Inactive
Brought to you by:
markjugg
|
From: Mark S. <ma...@su...> - 2008-08-06 19:18:37
|
On Wed, 6 Aug 2008 09:55:43 -0700
Amelia Ireland <ame...@gm...> wrote:
> Hi all,
>
> According to the D::FV::Results docs, you can add data to the valid
> results using the syntax
>
> $new_value = $r->valid('field',$new_value);
>
> If you use this after validating to add a valid value to a constraint
> that was previously invalid, is there anything which would update the
> list of invalid params? I couldn't see anything when I skimmed the code.
No, the invalid() list is not updated as a side-effect.
> I also couldn't see any way of editing the invalid / missing / unknown
> params without getting down and dirty and messing with the Results
> data structure directly. Is that right?
That's right.
> If I did want to be able to
> add/edit values post-validation and have $r->success / $r->invalid /
> $r->missing / $r->unknown return the correct, up-to-date values, would
> I be better off creating my own subclass of D::FV::Results with these
> capabilities?
I think so. In years of hanging out this mailing list, this is the first time
I've heard of something trying to use DFV this way.
I'm opening to hearing why this kind of functionality should be included in
DFV, but it seems very rarely needed.
I have seen some perhaps similar approaches in use:
- Running multiple validation cycles in a row for different stages.
- Pre-processing data before it given to DFV.
Mark
--
. . . . . . . . . . . . . . . . . . . . . . . . . . .
Mark Stosberg Principal Developer
ma...@su... Summersault, LLC
765-939-9301 ext 202 database driven websites
. . . . . http://www.summersault.com/ . . . . . . . .
|