datamade / chi-councilmatic

:eyes: keep tabs on Chicago city council
https://chicago.councilmatic.org/
MIT License
24 stars 16 forks source link

on committee page, show active legislation that the committee currently controls #69

Open fgregg opened 8 years ago

fgregg commented 8 years ago

relates to #64

cathydeng commented 8 years ago

kinda tricky to do this, b/c the listing on the committee page is actions, not bills. we don't index the bills on all committees that have been involved among the actions - we only index on the current controlling body

fgregg commented 8 years ago

well, it's not blocking.

fgregg commented 8 years ago

I suppose I'm just bugged by the arbitrariness of 300, could we return all stuff they did in their last meeting?

cathydeng commented 8 years ago

that would leave very little activity for most committees, though. I think we should keep showing the full activity feed for most committees, since there's no action feed anywhere else on the site. the transportation & public way committee is just an outlier b/c it has ~17k actions. the best way to handle this without setting an arbitrary cutoff would prob be to paginate

fgregg commented 8 years ago

I still would like a more natural break than 300.

maybe in the past year?

cathydeng commented 8 years ago

hm one thing that could be interesting/useful: a link to view all active legislation currently controlled by this committee

cathydeng commented 8 years ago

past year might be a bit much - 300 grabs back to nov 2015 for transportation. we could calculate actions since the past N committee meetings, but that could make page load a tad bit slower so idk abt the tradeoff

fgregg commented 8 years ago

I like the link idea of all active legislation controlled by committee. That's a good solution.

fgregg commented 8 years ago

Here's a query that shows all the active legislation controlled by a committee (In this case the rules committee):

select bill_id, slug, last_action_date, last_action.description from (select distinct on (bill_id) * from councilmatic_core_action order by bill_id, -"order") as last_action inner join councilmatic_core_actionrelatedentity on last_action.id = councilmatic_core_actionrelatedentity.action_id inner join councilmatic_core_bill on councilmatic_core_bill.id = bill_id where last_action.classification = 'committee-referral' and councilmatic_core_bill.legislative_session_id = 3 and entity_name = 'Committee on Committees, Rules and Ethics' order by last_action_date ;

The results are interesting

 bill_id |    slug     |    last_action_date    | description 
---------+-------------+------------------------+-------------
   35272 | o-2015-4591 | 2015-06-17 00:00:00-05 | Referred
   22478 | o-2015-7779 | 2015-10-21 00:00:00-05 | Referred
   29157 | o-2015-8185 | 2015-11-18 00:00:00-06 | Referred
   23374 | o-2015-8197 | 2015-11-18 00:00:00-06 | Referred
   40702 | o-2016-216  | 2016-01-13 00:00:00-06 | Referred
   30540 | o-2016-232  | 2016-01-13 00:00:00-06 | Referred
   34296 | r-2016-94   | 2016-02-10 00:00:00-06 | Referred
   37572 | o-2016-2585 | 2016-04-13 00:00:00-05 | Referred
   38187 | r-2016-247  | 2016-04-13 00:00:00-05 | Referred