I am building a Django data model and I want to be able to store an array of strings in one of the variables; how can I do that?
e.g.
JavaScript
x
4
1
class myClass(models.Model):
2
title = models.CharField(max_length=50)
3
stringArr = models.???
4
Thanks for the help.
Advertisement
Answer
Make another model that holds a string with an optional order, give it a ForeignKey
back to myClass
, and store your array in there.