0

I have a form that save lists as strings, I want to convert those strings to lists before save in DB.

I'm using python3 and Django.

The strings looks like: '["MEX","MTY","GDL","BJX","QRO","PBC","TLC","CUN","EM","CUU"]'

what will be the most pythonic way to do that?

Tomás Díaz Toro
  • 335
  • 1
  • 2
  • 11

1 Answers1

2
import json

json.loads('["MEX","MTY","GDL","BJX","QRO","PBC","TLC","CUN","EM","CUU"]')
miroli
  • 234
  • 1
  • 7