-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Update Models and Views for Councilmatic 2.5 #499
Conversation
@@ -485,21 +484,6 @@ def board_event_minutes(self): | |||
return doc.url | |||
|
|||
|
|||
class LAMetroEventMedia(EventMedia): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks like a work around a data import issue, and I think it will not be necessary. I'll keep track of it though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't need this model.
@@ -1,5 +1,4 @@ | |||
psycopg2==2.7.6.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
psycopg2 is properly a dependency of django-councilmatic.
Following the pattern described in the Caktus post: https://www.caktusgroup.com/blog/2017/03/14/production-ready-dockerfile-your-python-django-app/' The migration is part of the entrypoint instead of a separate management command. + I think this is pretty clear, but I familiar with bash scripting + uses the docker-compose health checks (which are v. good) + makes controlling when to migrate simpler (env var in app context) - you need to understand some bash to understand the docker-entrypoint.sh
@@ -119,3 +119,7 @@ | |||
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor' | |||
|
|||
ADV_CACHE_INCLUDE_PK = True | |||
|
|||
import socket |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this stuff allows the django toolbar to work with docker.
@@ -166,19 +166,12 @@ <h4><i class='fa fa-fw fa-calendar-o'></i> Board of Directors Meetings</h4> | |||
"info": false, | |||
"bLengthChange": false, | |||
"paging": false, | |||
"aaSorting": [ [3,'asc'] ], | |||
"aaSorting": [ [1,'asc'] ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this has our data table sort by last name of the person.
@@ -1,4 +1,2 @@ | |||
[pytest] | |||
DJANGO_SETTINGS_MODULE = tests.test_config | |||
filterwarnings = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this causes a fatal error in django 2.1
this monster has been broken up. |
Overview
This PR updates the models and views for councilmatic 2.5, as well as search and management commands.
It is nearly feature complete (modulo bugs), but not completely. I want to discuss with @hancush what we want to bring into this PR versus what we should wait on to make things more reviewable.
Notes
This PR depends on changes to the scrapers and django-councilmatic. I believe they can be reviewed separately
Also, we are bit out of synch with LA metro master, we should discuss how we want to handle that.
Testing Instructions
Move
councilmatic/settings_deployment.py.example
tocouncilmatic/settings_deployment.py
and add aGOOGLE_API_KEY
setting so that the maps will work.visit http://localhost:8011/
The local site should be the same as the production site with a few exceptions:
Headshots
We have changed the way we handle head shots. Now, you upload headshots through the admin interface.
docker-compose run --rm -e DJANGO_MANAGEPY_MIGRATE=off app python manage.py createsuperuser
docker-compose run --rm -e DJANGO_MANAGEPY_MIGRATE=off app python manage.py update_headshots
Descriptions of committees and people
Currently, the
settings_jurisdiction.py
contains descriptions of committees and biographies of people. These get associated with the individual views by keying off of slugs. As the slugs for people and committees depend on their OCD id the slugs will be different in your local development version.To test that the current approach works, you can edit the
settings_jurisdiction.py
and update the slugs to line up with your local database.Going forward, I would recommend making these types of data attributes of the appropriate models, which will be updated and edited in an admin interface. Then we can pull the data for people and orgs as fixtures and load them as part of an initial ETL. (this can be addressed in the data migration scope item).
Issue Tracking
Some tests won't pass until I get these sorted out, but I wanted to huddle with @hancush before pushing forward.