[Maypole] Search for zero

From: Dave Slack (dbavirt at gmail.com)
Date: Tue Oct 12 2004 - 22:51:31 BST


The following patch allows searching for '0' in a column. Because 0
evaluates to false, it was not added to %values.

*** CDBI.pm Tue Oct 12 15:47:17 2004
--- /home/dslack/Apache-MVC-20041007/lib/Maypole/Model/CDBI.pm Wed Oct
 6 19:00:09 2004
***************
*** 97,103 ****
      my $oper = "like"; # For now
      my %params = %{ $r->{params} };
      my %values = map { $_ => { $oper, $params{$_} } }
! grep { defined $params{$_} and $fields{$_} } keys %params;
  
      $r->template("list");
      if ( !%values ) { return $self->list($r) }
--- 97,103 ----
      my $oper = "like"; # For now
      my %params = %{ $r->{params} };
      my %values = map { $_ => { $oper, $params{$_} } }
! grep { $params{$_} and $fields{$_} } keys %params;
  
      $r->template("list");
      if ( !%values ) { return $self->list($r) }

_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:56 GMT