Skip to content

Commit

Permalink
Bugfix: filter by digit level. Fixes COL-465.
Browse files Browse the repository at this point in the history
  • Loading branch information
makmanalp committed Aug 10, 2015
1 parent ccc797b commit dea6c90
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions colombia/data/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,13 @@ def eey_location_products(entity_type, entity_id, buildingblock_level):
if location_level == "department":
q = DepartmentProductYear.query\
.filter_by(department_id=entity_id)\
.filter_by(level=buildingblock_level)\
.all()
return marshal(schemas.department_product_year, q)
elif location_level == "municipality":
q = MunicipalityProductYear.query\
.filter_by(municipality_id=entity_id)\
.filter_by(level=buildingblock_level)\
.all()
return marshal(schemas.municipality_product_year, q)
else:
Expand All @@ -145,11 +147,13 @@ def eey_location_industries(entity_type, entity_id, buildingblock_level):
if location_level == "department":
q = DepartmentIndustryYear.query\
.filter_by(department_id=entity_id)\
.filter_by(level=buildingblock_level)\
.all()
return marshal(schemas.department_industry_year, q)
elif location_level == "municipality":
q = MunicipalityIndustryYear.query\
.filter_by(municipality_id=entity_id)\
.filter_by(level=buildingblock_level)\
.all()
return marshal(schemas.municipality_industry_year, q)
else:
Expand Down

0 comments on commit dea6c90

Please sign in to comment.