Skip to content

Commit

Permalink
Add new create_property and update_with_espm endpoint (#4012)
Browse files Browse the repository at this point in the history
* 179d create_property endpoint

* precommit

* adding property id, state id, and view id to create response

* Partial fixes for handling bad data

* Verify property exists and belongs to org

* start of new serializer and controlling extra_data fields for 179d

* fix property create endpoint

* Formatting

* fix org_id on column views

* add report_format to PM download so spreadsheet can be downloaded

* updating BAE and small tweak since assets are now typed

* update BAE processing in reader

* updating BAE to v0.1.14

* remove uneeded view

* Add ESPM download for single property (via API) (#4158)

* add single property download method

* add viewset for downloading single espm report

* fix BAE migration and update swagger schema

* rename pm report single to download

* update lokalise notes and pull from latest from website

* initial commit with a new update with ESPM function. need to get the backend method finished

* enable udpate_with_espm

* add test and column mapping profile helper to load in the data

* fix example file that was downloaded from espm

* fix comment formats

* file paths

* style espm modal and fix both upload methods

* put tmp files into the projects media dir

* add column mapping profile param to update_with_espm

* put tmp files into the projects media dir

* add status to dresponse for pyseed

* do not save in media_root

* precommit

* allow different urls for better and at during testing

* return the mapping profile object when creating from file

* add tests to ensure read_only fields are protected

* Update models.py

* Update models.py

* - Removed broken `property_id` option
- Fixed extra_data columns to only ones that actually apply
- Changed `merge_state` from 0 to 1
- Added ValueError handling

* Small fixes

* Fix 179d ESPM update endpoint to run in foreground with Celery enabled (#4211)

* Fixed bae object accessors

* create two new methods for running save_raw and map to the foreground

* fix type

---------

Co-authored-by: Alex Swindler <[email protected]>

---------

Co-authored-by: Nicholas Long <[email protected]>
Co-authored-by: Alex Swindler <[email protected]>
Co-authored-by: Nicholas Long <[email protected]>
  • Loading branch information
4 people authored Sep 6, 2023
1 parent 680b6a2 commit 7925a85
Show file tree
Hide file tree
Showing 39 changed files with 1,697 additions and 94 deletions.
44 changes: 43 additions & 1 deletion .cspell/custom-dictionary-workspace.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ afterwards
ajax
Aleck
Amongst
analysispropertyview
Andriy
angularjs
api
Expand All @@ -26,8 +27,10 @@ AWS
backend
backends
badpass
basestring
bashrc
bedes
biffh
Bool
boolean
BrowserDefinition
Expand All @@ -36,7 +39,7 @@ bsyncr
buildingsnapshot
BuildingSnapshot
BuildingSnapshots
BUILDINGSYNC
buildingsync
bytestring
calendarize
canonicalbuilding
Expand All @@ -55,6 +58,8 @@ cli
cmp
codebase
collectstatic
columnlistprofile
columnmappingprofile
comparators
concat
cond
Expand All @@ -66,8 +71,11 @@ coparents
crlf
css
csv
csvfile
csvreader
Ctrl
customizable
datacoercions
dataset
datasets
datasource
Expand All @@ -81,6 +89,7 @@ dest
dev
dict
dicts
diffupdate
django
Django
docker0
Expand All @@ -91,6 +100,7 @@ edgecase
energystar
enums
env
ESPM
eui
eula
fieldname
Expand All @@ -111,19 +121,22 @@ geocode
geocoded
geocoding
geocodings
geomodels
getattr
getenv
getitem
gis
Github
Google
graphviz
greenbutton
gte
Gunter
Gzip
hardcoded
Homebrew
hotfix
hpxml
href
html
iand
Expand All @@ -140,11 +153,13 @@ iterable
Iterable
iteritems
js
JSESSIONID
jshint
json
JsonField
JSONField
kBtu
klass
kubectl
Kubectl
Kubernetes
Expand All @@ -170,9 +185,12 @@ mappable
mapquest
mcm
metadata
meterdata
meterreading
middleware
MIDDLEWARE
mixin
mmbtu
ModelSerializer
multipart
Multipart
Expand All @@ -186,12 +204,16 @@ nginx
nlong
nodejs
noncanonicalprojectbuildings
nondefault
nones
noqa
npm
nrows
num
Octant
officedocument
onload
openxmlformats
OperationalError
OrderedDict
OrderedDicts
Expand Down Expand Up @@ -221,12 +243,14 @@ PrimaryKeyRelatedField
projectbuilding
propertystate
propertyview
prprty
py
Pyright
pytype
pytz
qqfile
qs
quantityfield
queryset
querysets
readthedocs
Expand All @@ -247,26 +271,33 @@ scalable
seeddb
seedorg
seeduser
selfvars
sendmail
serializable
serializer
serializers
servlet
setUp
setUpClass
sha
signup
spreadsheetml
springframework
sqft
Starke
statuslabel
str
strcmp
strftime
subclasses
subdirectory
Submodules
submonthly
suborg
Subpackages
subtask
sudo
superperms
superset
TableRows
tastypie
Expand All @@ -276,6 +307,7 @@ taxlots
TaxLots
taxlotstate
taxlotview
taxview
td
tearDown
templatetags
Expand Down Expand Up @@ -305,13 +337,18 @@ Uncomment
ungeocoded
unicode
unittest
unlinkable
unmatch
unmatching
unmerge
unmerges
unpair
unresolvable
untracked
uom
uploader
uploaderfunc
ureg
uri
url
urllist
Expand All @@ -338,9 +375,14 @@ wildcards
workflow
wsgi
xlarge
xlrd
xlsxwriter
xml
xmltodict
xpath
XPath
XPATH
xpaths
XSLX
yasg
yml
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ seed/data_importer/tests/data/tmp_*
seed/data_importer/tests/data/~*
seed/tests/api/api_test_user.json
seed/building_sync/tests/data/test_file.xml
seed/tests/output
test.sqlite

# Ignore all protractor coverage
Expand Down
11 changes: 9 additions & 2 deletions docs/source/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ Translating SEED

1. Update translations on `lokalise`_.

2. Copy lokalise.cfg.example to lokalise.cfg. Update API token.
2. Copy lokalise.yml.example to lokalise.yml. Update API token.

3. Install lokalise locally

.. code:: bash
brew tap lokalise/cli-2
brew install lokalise2
3. Run scripts if you have Lokalise CLI installed. If not, see scripts for manual steps.

Expand Down Expand Up @@ -76,6 +83,6 @@ Compare:

<h2>{$:: inventory_type == 'taxlots' ?
translations['INCLUDE_SHARED_TAXLOTS'] :
translations['INCLUDE_SHARED
translations['INCLUDE_SHARED']

.. _lokalise: https://lokalise.com/project/3537487659ca9b1dce98a7.36378626/?view=multi
Binary file modified locale/en_US/LC_MESSAGES/django.mo
Binary file not shown.
42 changes: 42 additions & 0 deletions locale/en_US/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ msgstr "Audit Template Organization Token"
msgid "Audit Template Password"
msgstr "Audit Template Password"

msgid "Audit Template Upload Results"
msgstr "Audit Template Upload Results"

#: seed/models/models.py:136
msgid "Auditing"
msgstr "Auditing"
Expand Down Expand Up @@ -570,6 +573,9 @@ msgstr "Configuration"
msgid "Confirm"
msgstr "Confirm"

msgid "Confirm Audit Template Building Import?"
msgstr "Confirm Audit Template Building Import?"

msgid "Confirm Save Mappings?"
msgstr "Confirm Save Mappings?"

Expand Down Expand Up @@ -991,6 +997,15 @@ msgstr "----Choose energy type----"
msgid "ENERGY_UNIT_DISPLAY_CHOICE_PLACEHOLDER"
msgstr "----Change display unit----"

msgid "ESPM Password"
msgstr "ESPM Password"

msgid "ESPM Property ID"
msgstr "ESPM Property ID"

msgid "ESPM Username"
msgstr "ESPM Username"

msgid "EUI"
msgstr "EUI"

Expand Down Expand Up @@ -1144,6 +1159,9 @@ msgstr "File types supported: <strong>.csv</strong>, <strong>.xls</strong>, <str
msgid "Failed to delete inventory"
msgstr "Failed to delete inventory"

msgid "Fetching your buildings from Audit Template..."
msgstr "Fetching your buildings from Audit Template..."

msgid "Field"
msgstr "Field"

Expand Down Expand Up @@ -1416,9 +1434,15 @@ msgstr "Ignored tax lot duplicates within the import file"
msgid "Import Access Level Instances"
msgstr "Import Access Level Instances"

msgid "Import Audit Template Buildings"
msgstr "Import Audit Template Buildings"

msgid "Import Portfolio Manager Data"
msgstr "Import Portfolio Manager Data"

msgid "Import directly from ESPM"
msgstr "Import directly from ESPM"

msgid "Import from Audit Template"
msgstr "Import from Audit Template"

Expand Down Expand Up @@ -2753,6 +2777,9 @@ msgstr "Select All Columns"
msgid "Select None"
msgstr "Select None"

msgid "Select Properties to Update"
msgstr "Select Properties to Update"

msgid "Select a Custom Report to get started!"
msgstr "Select a Custom Report to get started!"

Expand Down Expand Up @@ -3086,6 +3113,9 @@ msgstr "There was an error loading the page"
msgid "This action replaces any of your current columns with the comma-delmited columns you provided. Would you like to continue?"
msgstr "This action replaces any of your current columns with the comma-delmited columns you provided. Would you like to continue?"

msgid "This action updates properties within the selected cycle with data from the Audit Template account associated with this organization. Only Properties with Audit Template Building IDs corresponding to those saved in Audit Template will be updated."
msgstr "This action updates properties within the selected cycle with data from the Audit Template account associated with this organization. Only Properties with Audit Template Building IDs corresponding to those saved in Audit Template will be updated."

msgid "This cycle name is already taken."
msgstr "This cycle name is already taken."

Expand Down Expand Up @@ -3259,12 +3289,21 @@ msgstr "Update Salesforce"
msgid "Update UBID"
msgstr "Update UBID"

msgid "Update with Audit Template"
msgstr "Update with Audit Template"

msgid "Update with BuildingSync"
msgstr "Update with BuildingSync"

msgid "Update with ESPM"
msgstr "Update with ESPM"

msgid "Updated"
msgstr "Updated"

msgid "Updating selected properties..."
msgstr "Updating selected properties..."

msgid "Upload Access Level Instances"
msgstr "Upload Access Level Instances"

Expand All @@ -3280,6 +3319,9 @@ msgstr "Upload Green Button Data"
msgid "Upload Portfolio Manager Data"
msgstr "Upload Portfolio Manager Data"

msgid "Upload Single ESPM Property"
msgstr "Upload Single ESPM Property"

msgid "Upload a Spreadsheet"
msgstr "Upload a Spreadsheet"

Expand Down
Binary file modified locale/fr_CA/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit 7925a85

Please sign in to comment.