Skip to content

Commit

Permalink
Merge branch 'develop' into 1833-ulid-footprints
Browse files Browse the repository at this point in the history
  • Loading branch information
axelstudios committed Apr 8, 2019
2 parents a505e15 + d810c46 commit ff3b18c
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 22 deletions.
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
# SEED Version 2.5.0

Add GIS related functionality.
Date Range: 02/19/19 - 03/27/19

Add GIS related functionality. Make sure to review the [migrations.mst](docs/source/migrations.rst) file on how to deploy the update.

Closed Issues:
- Fixed [#421]( https://github.com/SEED-platform/seed/issues/421 ), Reports - Message saying why there is no data
- Fixed [#1730]( https://github.com/SEED-platform/seed/issues/1730 ), Error importing BuildingSync File
- Fixed [#1734]( https://github.com/SEED-platform/seed/issues/1734 ), segfault when loading a lot of records to view in Inventory List
- Feature [#1741]( https://github.com/SEED-platform/seed/issues/1741 ), BuildingSync batch import from UI
- Fixed [#1811]( https://github.com/SEED-platform/seed/issues/1811 ), Unmerge Last doesn't work for BuildingSync XML files
- Fixed [#1812]( https://github.com/SEED-platform/seed/issues/1812 ), Merge screen doesn't show extra data fields
- Fixed [#1815]( https://github.com/SEED-platform/seed/issues/1815 ), Property labels are not in the export file
- Fixed [#1831]( https://github.com/SEED-platform/seed/issues/1831 ), Clean up database tables
- Feature [#1832]( https://github.com/SEED-platform/seed/issues/1832 ), Update BuildingSync to Version 1.0
- Fixed [#1833]( https://github.com/SEED-platform/seed/issues/1833 ), Add ULID, Building Footprint, and Tax Lot Footprint to Database
- Fixed [#1837]( https://github.com/SEED-platform/seed/issues/1837 ), Dimensionality Error
- Fixed [#1838]( https://github.com/SEED-platform/seed/issues/1838 ), Column Mappings can fail to load in the UI


# SEED Version 2.4.2

Expand Down
2 changes: 1 addition & 1 deletion docker/postgres/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM postgres:11.1

ENV POSTGIS_MAJOR 2.5
ENV POSTGIS_VERSION 2.5.1+dfsg-1.pgdg90+1
ENV POSTGIS_VERSION 2.5.2+dfsg-1~exp1.pgdg90+1

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down
2 changes: 1 addition & 1 deletion docs/source/developer_resources.rst
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ Release Instructions

To make a release do the following:

1. Github admin user, on develop branch: update the ``package.json`` and ``setup.py`` file with the most recent version number. Always use MAJOR.MINOR.RELEASE.
1. Github admin user, on develop branch: update the ``package.json`` file with the most recent version number. Always use MAJOR.MINOR.RELEASE.
2. Update the ``docs/sources/migrations.rst`` file with any required actions.
3. Run the ``docs/scripts/change_log.py`` script and add the changes to the CHANGELOG.md file for the range of time between last release and this release. Only add the *Closed Issues*. Also make sure that all the pull requests have a related Issue in order to be included in the change log.

Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ probablepeople==0.5.4
geojson==2.4.1

# pnnl/buildingid
-e git+https://github.com/SEED-platform/buildingid.git@475dfd6e0a10a8b0cd0cd06194eab72c31a00194#egg=buildingid
-e git+https://github.com/SEED-platform/buildingid.git@fd9067f70ae40f6ae3bf2bad6e31b5d2a9e8b150#egg=buildingid

enum34==1.1.6 # enum34 needs to be specified to support cryptography and oauth2
oauthlib==2.0.2
Expand Down
13 changes: 0 additions & 13 deletions seed/models/tax_lot_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,19 +381,6 @@ def get_related(cls, object_list, show_columns, columns_from_database):
if obj_dict.get('measures'):
del obj_dict['measures']

# # This isn't currently used, but if we ever re-enable it we need to prefetch all of the label data using a
# # single query for performance. This code causes one query with a join for every record
# label_string = []
# if hasattr(obj, 'property'):
# for label in obj.property.labels.all().order_by('name'):
# label_string.append(label.name)
# obj_dict['property_labels'] = ','.join(label_string)
#
# elif hasattr(obj, 'taxlot'):
# for label in obj.taxlot.labels.all().order_by('name'):
# label_string.append(label.name)
# obj_dict['taxlot_labels'] = ','.join(label_string)

results.append(obj_dict)

return results
24 changes: 19 additions & 5 deletions seed/views/tax_lot_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def export(self, request):
.. code-block::
{
"ids": [1,2,3],
"columns": ["tax_jurisdiction_tax_lot_id", "address_line_1", "property_view_id"]
"ids": [1,2,3],
"columns": ["tax_jurisdiction_tax_lot_id", "address_line_1", "property_view_id"]
}
---
Expand All @@ -70,7 +70,7 @@ def export(self, request):
required: true
paramType: query
- name: ids
description: list of property ids to export (not property views)
description: list of property/taxlot ids to export (not property/taxlot views)
required: true
paramType: body
- name: columns
Expand Down Expand Up @@ -114,6 +114,7 @@ def export(self, request):
filter_str = {'cycle': cycle_pk}
if hasattr(view_klass, 'property'):
select_related.append('property')
prefetch_related = ['property__labels']
filter_str = {'property__organization_id': org_id}
if ids:
filter_str['property__id__in'] = ids
Expand All @@ -122,18 +123,31 @@ def export(self, request):

elif hasattr(view_klass, 'taxlot'):
select_related.append('taxlot')
prefetch_related = ['taxlot__labels']
filter_str = {'taxlot__organization_id': org_id}
if ids:
filter_str['taxlot__id__in'] = ids
# always export the labels
column_name_mappings['taxlot_labels'] = 'Tax Lot Labels'

model_views = view_klass.objects.select_related(*select_related).filter(
**filter_str).order_by('id')
model_views = view_klass.objects.select_related(*select_related).prefetch_related(*prefetch_related).filter(**filter_str).order_by('id')

# get the data in a dict which includes the related data
data = TaxLotProperty.get_related(model_views, column_ids, columns_from_database)

# add labels
for i, record in enumerate(model_views):
label_string = []
if hasattr(record, 'property'):
for label in list(record.property.labels.all().order_by('name')):
label_string.append(label.name)
data[i]['property_labels'] = ','.join(label_string)

elif hasattr(record, 'taxlot'):
for label in list(record.taxlot.labels.all().order_by('name')):
label_string.append(label.name)
data[i]['taxlot_labels'] = ','.join(label_string)

# force the data into the same order as the IDs
if ids:
order_dict = {obj_id: index for index, obj_id in enumerate(ids)}
Expand Down

0 comments on commit ff3b18c

Please sign in to comment.