Comment 3 for bug 385919

Revision history for this message
Curtis Hovey (sinzui) wrote : Re: "Releases:" not omitted from project group's project listing when empty

This is not easy as I first thought. The templates/macros expect a list, and in many cases the list is created by a view. Both Product and ProductSeries return a ResultSet. So the problem is that incompatible objects are being passed to the portlets and macros.

The simplest way to fix this is to change the model objects to return lists because that is how we want to use them.
      * Change the models to return lists
      * Update the three callsites that use count() to use len()
        Note that they are tests, not code.
      * Update the 10 callsites that check for empty lists to tal:define
        them first.

The alternate approach to make resultsets compatible objects, which in this cases means adding counts. Note that Storm does not use this, so this approach must be dismantled in the future.
    * Change the views that return lists to add a count attribute to them
    * Update the 10 callsites that check for empty lists to tal:define them first and verify the count