[html-formfu] nested params merged
Jonas Alves
jonas.alves at gmail.com
Wed Oct 31 15:46:20 GMT 2007
On 31/10/2007, Carl Franks <fireartist at gmail.com> wrote:
> On 30/10/2007, Jonas Alves <jonas.alves at gmail.com> wrote:
> >
> > Hi Carl,
> > Great work. :)
> > May I know if you pretend to implement the validation without the dot
> > parameters as I suggested? If not, is it because you don't like it? If
> > is because you don't want to wast time on it, will you accept a patch?
>
> Well, I have to admit I don't like the approach DBIC::Validation::FormFu takes.
Yes, I know :/
> I feel that it's a bit of an abuse to pass $dbic->create() a complex
> data structure that it wouldn't normally handle, particularly when
> DBIC is trying to subvert it by stripping keys containing "."
The structures I want to pass to it are structures that dbic can handle.
The date element is an exception.
DBIC can handle complex structures to populate relationships.
DBIC will accept something like:
{
username => 'jgda',
address => {
street => '...',
zipcode => '...',
number => '...',
}
}
That's one of the reasons I would like formfu to handle that too.
> Your argument that we should support deep hash-refs from JSON, etc, is
> more persuasive though ;)
Yes, that's another reason. :)
> So I've added support for this, but with caveats.
Great. :D
> If you pass $form->query() or $form->process() an unblessed hash-ref,
> it passes it off to HTML::FormFu::FakeQuery to handle.
> This means that it won't support file uploads - but that was the case already.
Yes, of course.
I forgot the file upload support when implemented DBIC::V::FormFu. I
can make it accept a catalyst request too, but yes, that really would
be a bit of an abuse. :)
> The only tests are in "t/nested/pre_expanded.t" - and it's not
> documented either - but hopefully it'll be enough for you to
> experiment with.
Thanks a lot Carl.
I will play with it. :)
--
Jonas
More information about the HTML-FormFu
mailing list