Changeset 2394


Ignore:
Timestamp:
06/09/20 20:03:29 (4 years ago)
Author:
nanardon
Message:

add + to filter

Location:
trunk/LATMOS-Accounts/lib/LATMOS/Accounts
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm

    r2393 r2394  
    11171117        # attr=foo => no extra white space ! 
    11181118        # \W is false, it is possible to have two char 
    1119         my ($NegFilter, $attr, $attrref, $operator, $val) = $item =~ /^([\!\-]?)(\w+)(?:\.([\.\w]+))?(?:([^\w*]+)(.+))?$/ or next; 
     1119        my ($NegFilter, $attr, $attrref, $operator, $val) = $item =~ /^([\!\+\-]?)(\w+)(?:\.([\.\w]+))?(?:([^\w*]+)(.+))?$/ or next; 
    11201120        if (!$operator) { 
    11211121            $operator = '~'; 
     
    11781178            $results->{$attrKey} ||= {}; 
    11791179            $results->{$attrKey}{$_} = -1 foreach (@results); 
     1180        } elsif ($NegFilter eq '+') { 
     1181            # Filter result to filter from attribute result 
     1182            $results->{$attrKey} ||= {}; 
     1183            $results->{$attrKey}{$_} = 1 foreach (@results); 
    11801184        } else { 
    11811185            $results->{$attrKey} ||= {}; 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Cli.pm

    r2393 r2394  
    129129                } else { 
    130130                    return( 
    131                         map { $_, "!$_", "-$_" } 
     131                        map { $_, "!$_", "-$_", "+$_" } 
    132132                        map { ( $_ . '=', $_ . '~' ) } $_[0]->base->list_canonical_fields($_[2], 'r') 
    133133                    ); 
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Cli/Object.pm

    r2393 r2394  
    118118        completion => sub { 
    119119            return( 
    120                 map { $_, "!$_", "-$_" } 
     120                map { $_, "!$_", "-$_", "+$_" } 
    121121                map { ( $_ . '=', $_ . '~' ) } $_[0]->base->list_canonical_fields($_[0]->{_otype}, 'r') 
    122122            ); 
Note: See TracChangeset for help on using the changeset viewer.