BuildingPermits

[
{
“id”: “caf3b9d5ce317d53”,
“description”: “Battery backup”,
“number”: “RE2303928”,
“jurisdiction”: “Berkeley”,
“type”: “Re) – electrical – 1 & 2 unit residential (building)”,
“fees”: “619.6”,
“status”: “active”,
“file_date”: “2023-10-02”,
“issue_date”: “2023-10-11”,
“final_date”: “2023-12-11”,
“construction_duration”: 61,
“approval_duration”: 9,
“contractor_id”: “KOm4dMLIuT”,
“address”: {
“street_no”: “3360”,
“street”: “DWIGHT WAY”,
“city”: “OAKLAND”,
“zip_code”: “94704”,
“state”: “CA”,
“latlng”: [
37.868443,
-122.24374
]
},
“tags”: [
“solar”,
“utilities”,
“residential”,
“solar_battery_storage”
]
},
{
“id”: “71c02bd70f7ce1c9”,
“description”: “Install 27 kwh back-up batteries in cabinet “,
“number”: “E2304692”,
“jurisdiction”: “Berkeley”,
“type”: “E) – electrical – 3+ residential units or commercial”,
“fees”: “615.06”,
“status”: “in_review”,
“file_date”: “2023-11-29”,
“construction_duration”: 154,
“approval_duration”: 204,
“address”: {
“street_no”: “544”,
“street”: “DWIGHT PL”,
“city”: “OAKLAND”,
“zip_code”: “94704”,
“state”: “CA”,
“latlng”: [
37.8671,
-122.24461
]
},
“tags”: [
“solar”,
“utilities”,
“residential”,
“solar_battery_storage”
]
},
{
“id”: “9525a96a93e0cdb7”,
“description”: “Install 27 kwh back-up batteries in cabinet”,
“number”: “B2303829”,
“jurisdiction”: “Berkeley”,
“job_value”: “5001.0”,
“type”: “B) – building alteration – 3+ residential units or commercial”,
“fees”: “779.53”,
“status”: “in_review”,
“file_date”: “2023-11-29”,
“construction_duration”: 154,
“approval_duration”: 204,
“address”: {
“street_no”: “544”,
“street”: “DWIGHT PL”,
“city”: “OAKLAND”,
“zip_code”: “94704”,
“state”: “CA”,
“latlng”: [
37.8671,
-122.24461
]
},
“tags”: [
“solar”,
“sitework”,
“residential”,
“solar_battery_storage”,
“commercial”
]
}
]

Saturday June 1st from 10:00pm to 01:00am Sunday Morning PST

247Apps Loan XML Editor Micro Application and Licenses API Scheduled Maintenance

 

We will be conducting an upgrade to our Online Toolbox for Loan XML Editor Micro Application and Licenses API to provide better security, stability and speed for our clients across United States. As usual, this upgrade will occur during the hours of the morning when you are all asleep.
Starting Saturday June 1st from @ 10:00pm PST. Our scheduled window for this maintenance cycle should be under 3 hours.
We apologize for any inconvenience this disruption may cause and thank you for your patience.

Thank you,
247AppsMobi – Micro Application Services Dev Team

Sunday August 27th from 10:00pm to 01:00am Monday Morning PST

247Apps and MyNetworkSolution VPS Scheduled Maintenance

 

We will be conducting an upgrade to our VPS Servers to provide greater security, stability and speed for our clients across United States and Canada. As usual, this upgrade will occur during the wee hours of the morning when you are all asleep.
Starting Sunday August 27th @ 10:00pm PST. Our scheduled window for this maintenance cycle should be under 3 hours.
We apologize for any inconvenience this disruption may cause and thank you for your patience.

Thank you,
247AppsMobi – Web Services of MyNetworkSolution Dev Team

Sunday February 12th from 11:00pm to 02:00am Monday Morning PST

247Apps VPS Scheduled Maintenance

 

We will be conducting an upgrade to our VPS Servers to provide greater stability and speed. This upgrade will occur during the wee hours of the morning when you are all asleep.
Starting Sunday February 12 @ 11:00pm PST. Our scheduled window for this maintenance cycle should be under 3 hours.
We apologize for any inconvenience this disruption may cause and thank you for your patience.

Thank you,
247AppsMobi – Web Services of MyNetworkSolution Dev Team

How to Return JSON Encoded Response for a non-dict object

In DJango, an HttpResponse sub-class helps to create a JSON-encoded response. It was called Serialized-Object response in Django < 1.7. Its default Content-Type header is set to application/JSON. The first parameter (data set), should be a dict instance. If non-dict object is passed in as the first parameter, a TypeError will be raised. To fix this error, we just need to add a parameter called “safe” to False in the method call JsonResponse.

TypeError: In order to allow non-dict objects to be serialized set the safe parameter to False

This is the fix:

return JsonResponse(["a", "b", 1, 2], safe=False)

The safe boolean parameter defaults is True. If it’s set to False, any object can be passed for serialization (otherwise only dict instances are allowed).

Example non-dict object:

some_object = [{‘pk’: 86, “model”: “machine_models.machinemodel”, “notes”: “This is warehouse imported machine.”}]

return JsonResponse(some_object,safe=False)

 

A complete sample:

from django.http import JsonResponse

def home_details(req):
    response = {
        'id': 1,
        'address': '123 Main St., San Jose, CA 95111',
        'beds': 3,
        'baths': 2,
        'status': Sold
    }
    return JsonResponse(response)