Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7692893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:57:26+00:00 2026-05-31T20:57:26+00:00

I am calling an API that returns JSON data. I am using json.loads to

  • 0

I am calling an API that returns JSON data. I am using json.loads to decode the JSON to Python as a dictionary. The dictionary that returns is a somewhat complex nested dictonary with nested lists as well.

For example:

{ "educations": { "_total": 1, "values": [{ "degree": "Bachelor of Arts", "fieldOfStudy": "Psychology", "schoolName": "Antioch University Seattle" }] }

How do I store each of the values into an SQLite database with the model defined as:

class Educations(models.Model):
    name = models.ForeignKey(Candidate)
    degree = models.CharField(max_length=200)
    fieldOfStudy = models.CharField(max_length=200)
    schoolName = models.CharField(max_length=200)

Each education is associated with a Candidate which is defined in the Candidate class (not shown here).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T20:57:28+00:00Added an answer on May 31, 2026 at 8:57 pm

    You can set the fields in new object like

    # Get after json.dump
    json_data = { "educations": { "_total": 1, "values": [{ "degree": "Bachelor of Arts", "fieldOfStudy": "Psychology", "schoolName": "Antioch University Seattle" }] }
    
    for each_education in json_data['educations']['values']
        new_education = Education(**each_education)
        # Set the name foreign key
        # new_educaiton.name = name
        new_education.save()
    

    Note: How you will get the data for the name foreignkey is not mention in your question so that also you can set.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm calling a web API exposed by TheyWorkForYou (TWFI). http://www.theyworkforyou.com/api/ I'm using the Python
The api I'm calling returns a json object of validation errors with the HTTP
I'm calling a funny API that returns a byte array, but I want a
I have a json object that I'm loading from wordpress using the JSON API
I am calling a vendor's Java API, and on some servers it appears that
I have an application that is performing HTTP Requests (specifically calling the FogBugz API)
I have a function calling another function to get data. That data might be
I am stuck in this problem, I am calling a webService that returns me
Say I am calling a third-party API which returns a Post, and I want
I'm calling a 3rd party API that uses OAuth for authentication, and I'm wondering

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.