-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #303 from lucyparsons/multi-dept-submission
Add multi-department support for photo submission
- Loading branch information
Showing
9 changed files
with
117 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from sqlalchemy import * | ||
from migrate import * | ||
|
||
|
||
from migrate.changeset import schema | ||
pre_meta = MetaData() | ||
post_meta = MetaData() | ||
|
||
|
||
raw_images = Table('raw_images', post_meta, | ||
Column('id', Integer, primary_key=True, nullable=False), | ||
Column('filepath', String(length=255)), | ||
Column('hash_img', String(length=120)), | ||
Column('date_image_inserted', DateTime), | ||
Column('date_image_taken', DateTime), | ||
Column('contains_cops', Boolean), | ||
Column('user_id', Integer), | ||
Column('is_tagged', Boolean, default=ColumnDefault(False)), | ||
Column('department_id', Integer), | ||
) | ||
|
||
|
||
def upgrade(migrate_engine): | ||
# Upgrade operations go here. Don't create your own engine; bind | ||
# migrate_engine to your metadata | ||
pre_meta.bind = migrate_engine | ||
post_meta.bind = migrate_engine | ||
post_meta.tables['raw_images'].columns['department_id'].create() | ||
|
||
|
||
def downgrade(migrate_engine): | ||
# Operations to reverse the above upgrade go here. | ||
pre_meta.bind = migrate_engine | ||
post_meta.bind = migrate_engine | ||
post_meta.tables['raw_images'].columns['department_id'].drop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{% extends "base.html" %} | ||
{% block content %} | ||
|
||
<link href="{{ url_for('static', filename='css/dropzone.css') }}" rel="stylesheet"> | ||
|
||
<div class="container theme-showcase" role="main"> | ||
|
||
<div class="text-center frontpage-leads"> | ||
<h1><small>Submit images of officers in action in: </small></h1> | ||
{% for department in departments %} | ||
<p> | ||
<a href="/submit/department/{{ department.id }}" class="btn btn-lg btn-primary"> | ||
<span class="glyphicon glyphicon-upload" aria-hidden="true"></span> | ||
{{ department.name }}</a> | ||
</p> | ||
{% endfor %} | ||
</div> | ||
|
||
</div> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters