impactlab / oeem-client

:bangbang: MOVED TO https://github.com/openeemeter/frontend-datastore-client-old - Client Application of the OEEM Energy Datastore providing a front-end/dashboard experience.
0 stars 0 forks source link

on project detail view, show the blocks that include the project #9

Open cathydeng opened 8 years ago

cathydeng commented 8 years ago

@philngo has this been added to the api?

philngo commented 8 years ago

Yes - here is an example response:

GET http://datastore.url/datastore/project/18

JSON response ("projectblock_set" is newly added):

{
 "id":18,
 "project_owner":1,
 "project_id":"eaf1bd08-5810-4d9c-b96d-035fff1cab70",
 "baseline_period_start":"2007-11-10T00:00:00Z",
 "baseline_period_end":"2012-09-05T00:00:00Z",
 "reporting_period_start":"2012-11-15T00:00:00Z",
 "reporting_period_end":"2015-10-07T15:45:13.204964Z",
 "zipcode":"94102",
 "weather_station":null,
 "latitude":null,
 "longitude":null,
 "consumptionmetadata_set":[
    35,
    36
 ],
 "recent_meter_runs":[
    41,
    42
 ],
 "projectblock_set":[
    {
       "id":1,
       "name":"Sample Block 1",
       "project_owner":1
    },
    {
       "id":2,
       "name":"Sample Block 2",
       "project_owner":1
    },
    {
       "id":4,
       "name":"Sample Block 4",
       "project_owner":1
    }
 ]
}