Hi,

This isn't strictly a catalyst question, but it arose from a previous
thread,
http://lists.scsys.co.uk/pipermail/catalyst/2007-December/016329.html, on
parameter validation and the problems of code like

  my $user = $rs->create({ 
      is_admin => 0,
      username => $c->req->param('username'), 
  });


I'm using Data::FormValidator. If I have a DFV constraint on fields that 
shouldn't be multi-valued, something like:

sub is_single{
    my $c = shift;
    return sub{
        my $dfv = shift;
        $dfv->name_this('is_single');
        my $field = $dfv->get_current_constraint_field;
        my $data = $dfv->get_filtered_data;
        my $test = $data->{$field};
        return ref $test ? 0:1;
    }
}

should that allow me to use validated parameters in hashes with impunity
or am I missing the point of the problem?

cheers,
Cass


_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to