Roundup Tracker - Issues

Issue 2550708

classification
Title: Binary filter operators specific to "keyword" should be more generic
Type: Severity: normal
Components: Versions:
process
Status: new Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ber, ezio.melotti, rouilj
Priority: Keywords:

Created on 2011-07-01 15:24 by ber, last changed 2016-07-08 23:14 by rouilj.

Messages
msg4320 Author: [hidden] (ber) Date: 2011-07-01 15:23
Split out from issue2550648 (Should be possible to search for matching 
several keywords (keyword1 AND keyword2) especially from
msg4302:

| It is too much tied to tracker-specific aspects, such as a 'keyword' 
entity in the schema,
msg4361 Author: [hidden] (ezio.melotti) Date: 2011-08-08 22:08
See also msg4360.
msg5780 Author: [hidden] (rouilj) Date: 2016-07-08 02:14
Are you referring to the term keyword that shows up in the definition?

The term keyword is a bit of a red herring, but the basic
functionality seems to work for any link or multilink field.

I just tried the following patch to the demo
classic tracker:

                db_klass string:status;
                 db_content string:name;">
   <th i18n:translate="">Status:</th>
-  <td metal:use-macro="search_select_translated">
+  <td metal:use-macro="search_select_keywords">
     <tal:block metal:fill-slot="extra_options">
       <option value="-1,1,2,3,4,5,6,7" i18n:translate=""
               tal:attributes="selected python:value ==
'-1,1,2,3,4,5,6,7'">not resolved</option>

and I was able to generate the equivalent of "not resolved"
using or's between all of the statuses except for resolved.

What exactly "ties" this to the tracker?
msg5782 Author: [hidden] (ber) Date: 2016-07-08 06:48
Hi John,
thanks for taking a look.

I guess if this can be made to work on all fields that could 
profit from it and some instructions how to make it work
on custom fields, the issue would be resolved. 

In addition Ezio added that retired 'values' should not be shown
anymore in the popup. (Maybe that should become a separate issue?)

Best,
Bernhard
msg5786 Author: [hidden] (rouilj) Date: 2016-07-08 23:14
Hi Bernhard:

In message
<1467960524.02.0.644361449121.issue2550708@psf.upfronthosting.co.za> ,
Bernhard Reiter writes:
>I guess if this can be made to work on all fields that could 
>profit from it and some instructions how to make it work
>on custom fields, the issue would be resolved. 

Ok, I'll see what I can do.

I guess it would go into customizing.txt? That's where I find
search_select mentioned.

Basically if the search field is currently using

  <td metal:use-macro="search_select">
or
  <td metal:use-macro="search_select_translated">

change it to use:

  <td metal:use-macro="search_select_keywords">

It's pretty much a drop in replacement from what I can see (except for
translations done by search_select_translated. I have to admit I am
not sure how the translation works. Why do we have one non-translated
and one translated. Why not just the translated one???

The other question is are we confident enough in the code to want to
expand the doc for it? There are quite a few open issues with the code
that have gone unfixed.

Better would be a ticket to fix/review things first and then document
all as part of one ticket.

>In addition Ezio added that retired 'values' should not be shown
>anymore in the popup. (Maybe that should become a separate issue?)

That's easy I'll put it in now. The call to getnodeids needs to have
retired=0 added to it so it reads:

def list_nodes(request):
    prop = request.form.getfirst("property")
    cls = request.client.db.getclass(prop)
    items = []
    for nodeid in cls.getnodeids(retired=0):  # <-- add retired param
        l = cls.getnode(nodeid).items()
        l = dict([x for x in l if len(x) == 2])
        try:
            items.append((l['id'], l['name']))
        except KeyError:
            pass
    items.sort(key=lambda x: int(x[0]))
    return items

Tested it on my demo tracker and it seems to work.
History
Date User Action Args
2016-07-08 23:14:32rouiljsetmessages: + msg5786
2016-07-08 06:48:44bersetmessages: + msg5782
2016-07-08 02:14:20rouiljsetnosy: + rouilj
messages: + msg5780
2011-08-08 22:08:06ezio.melottisetnosy: + ezio.melotti
messages: + msg4361
2011-07-01 15:24:00bercreate