This pull request extends the post-save signals for OCD bills and events to also calculate and store the last action date for a bill. This logic was previously defined on the Metro bill model, however it will be useful across jurisdictions.
Note: We refresh the last action date on event save because event agenda items can influence the value of last action date.
If you haven't already, clone LA Metro: git clone https://github.com/datamade/la-metro-councilmatic.git and cd into the project directory.
Switch to the local Councilmatic branch: git checkout spike/hec/local-django-councilmatic. Update the volume mount in the scraper service to point at your local django-councilmatic directory.
Build the scraper service: docker-compose build --no-cache scrapers
Run a bill and event scrape: docker-compose run --rm scrapers sh -c "pupa update lametro bills window=7 --rpm=0 && pupa update lametro events window=14 --rpm=0". Confirm that they succeed.
Shell into your Councilmatic database and confirm that some bills have values for last_action_date:
docker-compose run --rm postgres psql -U postgres -d lametro
postgres=# select count(*) from councilmatic_core_bill where last_action_date is not null;
Description
This pull request extends the post-save signals for OCD bills and events to also calculate and store the last action date for a bill. This logic was previously defined on the Metro bill model, however it will be useful across jurisdictions.
Note: We refresh the last action date on event save because event agenda items can influence the value of last action date.
Related issues
Connects https://github.com/opencivicdata/scrapers-us-municipal/issues/300, https://github.com/datamade/la-metro-councilmatic/pull/541.
Testing instructions
django-councilmatic
.git clone https://github.com/datamade/la-metro-councilmatic.git
andcd
into the project directory.git checkout spike/hec/local-django-councilmatic
. Update the volume mount in the scraper service to point at your localdjango-councilmatic
directory.docker-compose build --no-cache scrapers
docker-compose run --rm scrapers sh -c "pupa update lametro bills window=7 --rpm=0 && pupa update lametro events window=14 --rpm=0"
. Confirm that they succeed.last_action_date
: