title: What's the right definition of peewee model while mapping from json file?
body: <p>Hi stack overflow community! This is my first question here, but I tried to find an answer beforehand. Right now I am working on loading data from json file <a href="https://randomuser.me/" rel="nofollow noreferrer">like so</a> (I actually have a json file named <code>persons.json</code>, not API) with the use of <code>peewee</code> to SQLite DB. As you can see, the json file has multiple nested dicts. My <code>peewee</code> model is as follows:</p>
  <pre><code>import json
  import sqlite3
  from peewee import *
  
  db = SqliteDatabase('persons.sqlite3')
  
  class Person(Model):
      gender = CharField()
      name = CharField()
      location = CharField()
      email = CharField()
      login = CharField()
      dob = CharField()
      registered = CharField()
      phone = CharField()
      cell = CharField()
      id_ = CharField()
      picture = CharField()
      nat = CharField()
      count_dob = IntegerField()
  </code></pre>
  <p>And this is how I load all the data from json file to SQLite DB:</p>
  <pre><code>db.connect()
  
  db.create_tables([Person])
  
  with open('persons.json', encoding='utf8') as persons:
      persons_data = json.load(persons)
  
  
  for person in persons_data['results']:
      p = Person(gender=person['gender'], name=person['name'], location=person['location'], email=person['email'], 
                  login=person['login'], dob=person['dob'], registered=person['registered'], phone=person['phone'],
                  cell=person['cell'], id_=person['id'], picture=person['picture'], nat=person['nat'])
  </code></pre>
  <p>My question is, do you think the variables in my model are correctly defined (basically every single one of them as a CharField) ? The thing is, later whenever I query the DB and I need to access some of these nested dictionaries, they are actually a string, which I can convert with the use of <code>ast.literal_eval</code> back to dict, but I don't think it looks nice. I thought of a solution - for all the 'dictionary type' variables in my model ('location', 'dob' etc), instead of using <code>CharField()</code> I could probably use <code>JSONField()</code> - not sure how to do that though. Could you please advise on that one?</p>