Re: Get all issues with attached files

Tom Ekberg <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.user
Message-ID <[email protected]>
anatoly t.,

I think the easiest way to do this is to define a new boolean attribute in your issue schema called something like has_files. Then in issue.item.html initialize it to python:bool(context.files). Be sure to define a <input type="hidden"> for it so it gets saved with the form. Something like this:

  <input type="hidden" name="has_files" tal:attributes="value python:bool(context.files)">

Then specify that in issue.search.html you can check for it like other boolean attributes, like this:

<tr tal:define="name string:has_files">
  <td metal:use-macro="column_input"></td>
  <td metal:use-macro="sort_input"></td>
  <td metal:use-macro="group_input"></td>
  <th i18n:translate="">Does this issue have files?</th>
  <td metal:use-macro="yesno_select"></td>
</tr>

You may need to reorder the columns so they line with the other <tr> elements in the search page.
If you use the above search code, put the following in your html/page.html with the other macros.

<!-- Use this for to search for boolean values. All it needs is the name. -->
<td metal:define-macro="yesno_select">
  <select tal:attributes="name name; id name"
          tal:define="value python:request.form.getvalue(name)">
    <option value="" i18n:translate="">don't care</option>
    <option value="" i18n:translate="" disabled="disabled">------------</option>
    <option tal:repeat="s python:[(1,'Yes'), (0,'No')]"
            tal:attributes="value python:s[0]; selected python:value == s[0]"
            tal:content="python:s[1]"></option>
  </select>
</td>

Of course, this only works with new issues and issues that have been edited after specifying the new code. You may have to use a shell script and roundup-admin to initialize the new issue schema attribute for the old issues.

Tom Ekberg
Senior Computer Specialist, Lab Medicine
University of Washington Medical Center
1959 NE Pacific St, MS 357110
Seattle WA 98195
work: (206) 598-8544
email: [email protected]

On Mon, 29 Sep 2014, anatoly techtonik wrote:

> Date: Mon, 29 Sep 2014 14:39:05 +0300
> From: anatoly techtonik <[email protected]>
> To: [email protected]
> Subject: [Roundup-users] Get all issues with attached files
> 
> Hi,
>
> I am trying to get all issues with attachments in one query,
> but I can't find what value I should specify so that Roundup
> filter matches "any" logic.
>
> http://roundup.sourceforge.net/docs/user_guide.html#entering-values-in-your-tracker
>
> It looks like the only way is to get ids of all issues, then all
> issues without patches (files=-1) and substract one list from
> the other.
>
> Please, CC.
> -- 
> anatoly t.
>
> ------------------------------------------------------------------------------
> Slashdot TV.  Videos for Nerds.  Stuff that Matters.
> http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
> _______________________________________________
> Roundup-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/roundup-users
>



------------------------------------------------------------------------------
Slashdot TV.  Videos for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.