Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

How to Use ChainMap

webdeveloper on Feb. 28, 2020

Hi, It is awesome. How can I get this data structure in Json format.

[
  {
    "SectionName": "Header",
    "SectionOrder": 0,
    "Fields": [
      {
        "ID": 0,
        "Order": -12,
        "Name": "ID",
        "Display": "ID",
        "Visible": true,
        "fieldType": null,
        "Width": null
      },
      {
        "ID": 0,
        "Order": -11,
        "Name": "FormSubmissionDate",
        "Display": "Submission Date",
        "Visible": true,
        "fieldType": "DatePicker",
        "Width": null
      },
      {
        "ID": 0,
        "Order": -10,
        "Name": "Site",
        "Display": "Site",
        "Visible": true,
        "fieldType": null,
        "Width": null
      },
      {
        "ID": 0,
        "Order": -9,
        "Name": "JobNumber",
        "Display": "Job Number",
        "Visible": true,
        "fieldType": null,
        "Width": null
      },
      {
        "ID": 0,
        "Order": -8,
        "Name": "SiteLevel",
        "Display": "Level",
        "Visible": true,
        "fieldType": null,
        "Width": null
      },
      {
        "ID": 0,
        "Order": -7,
        "Name": "Workplace",
        "Display": "Workplace",
        "Visible": true,
        "fieldType": null,
        "Width": null
      },
      {
        "ID": 0,
        "Order": -6,
        "Name": "SubmittedBy",
        "Display": "Submitted By",
        "Visible": true,
        "fieldType": null,
        "Width": null
      }
    ]
  },
  {
    "SectionName": "Notes",
    "SectionOrder": 1,
    "Fields": [
      {
        "ID": 17756,
        "Order": -5,
        "Name": "comments",
        "Display": "Comments",
        "Visible": true,
        "fieldType": "MultiLineEntry",
        "Width": null
      },
      {
        "ID": 17757,
        "Order": -4,
        "Name": "workers_present",
        "Display": "Workers Present",
        "Visible": true,
        "fieldType": "GlobalListPicker",
        "Width": null
      },
      {
        "ID": 17758,
        "Order": -3,
        "Name": "multiphoto_picker_1",
        "Display": "Pictures",
        "Visible": true,
        "fieldType": "MultiPhotoPicker",
        "Width": null
      }
    ]
  },
  {
    "SectionName": "Distribution",
    "SectionOrder": 2,
    "Fields": [
      {
        "ID": 17790,
        "Order": -2,
        "Name": "Report_Distribution1",
        "Display": "Report Distribution",
        "Visible": true,
        "fieldType": "GlobalListPicker",
        "Width": null
      }
    ]
  }
]

Ricky White RP Team on Feb. 28, 2020

Hi webdeveloper. If you want to learn how to serialize data to JSON, check out our course on it here: realpython.com/courses/working-json-data-python/

Become a Member to join the conversation.