Hi Carl!

Why not accepts hashes from stash in condition_from_stash? I read the DBIC.pm:

    if ( defined( my $from_stash = $attrs->{condition_from_stash} ) ) {
$condition = $condition ? { %{$condition} } : {}; # avoid overwriting attrs->{condition}
        for my $name ( keys %$from_stash ) {
            my $value = $form->stash->{ $from_stash->{$name} };

            croak "input value must not be a reference"
                if ref $value;

            $condition->{$name} = $value;
        }
    }

and If I unterstod the dump of form object well, this limitation isn't neccessary, but makes hard to create a flexibile conditions. I created various configs like this:

<condition>
  <id>
    > 1
  </id>
</condition>
<condition_from_stash>
  name user
</condition_from_stash>

placed the condition to the form's stash (tried in Catalyst environment):

$form->stash->{user} = { '!=' => $c->stash->{userRS}->name };

commented out the croak line above, and I got the correct query:

WHERE ( ( id > ? AND name != ? ) ): '1', 'Administrator'

What's your opinion?

Thanks

--
Gabor HALASZ <halas...@freemail.hu>

_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

Reply via email to