Opened 16 years ago

Last modified 15 years ago

#1129 closed enhancement

Filtering of child/parent items in table listing — at Version 1

Reported by: Jari Häkkinen Owned by: everyone
Priority: major Milestone: BASE 2.9
Component: web Version: trunk
Keywords: Cc:

Description (last modified by Nicklas Nordborg)

In many cases it would be nice to be able to filter on child or parent items in table listings. In a labeled extracts listing one would like to be able to filter on hybridizations or extracts (called 'Parents' in the view).

Change History (1)

comment:1 by Nicklas Nordborg, 16 years ago

Description: modified (diff)

The root problem with this is the same as for #1128. The child items are not part of the main table that builds up the table, but are fetched by additional queries (one query per column and row in the table). However, I think this problem may be easier to solve than #1128, since we don't need to retrieve the information. Possible ways forward are:

  1. Joining the tables with the child item information. I think I tried this a long time ago, but there was a problem with getting duplicate rows since we are joining a one-to-many relation.
  2. Generating subqueries that returns the id of the parent item, which is then used in the filter. Something like this this:
select * from Parent p where ... 
p.id IN (
  select p.id from Child c join c.parents p where c.name = <filter>
)
Note: See TracTickets for help on using tickets.