(MySQL newbie alert)
I receive back from an API call values for a field price, and they are almost always a string e.g.
u'price': u'$49.99',
Sometimes though, there are two prices (the former price and the current one), and the API places them in a Python list:
u'price': [
u'$9.99',
u'$1,099.99'
],
With my column price defined as a varchar(255), the insertion fails when the price is a list. I don't want to split such pairs of price out into two separate columns. I know I can use Python to decompose the list into a string before the insertion, but is there a way in MySQL to allow for both a string and a list?