I have a Django model that needs to represent a set of data. What is the canonical way to implement this? I don’t see a models.SetField() in the documentation. I could use a text field and pickling.
I recognize that this isn’t the fastest way to do it, but this part of the code doesn’t need to be super fast – simplicity is better at this point.
I’m not exactly sure what you are trying to achieve, but it seems to me your looking for some getter/setter functionality that automatically pickles the values:
You can then do something like
obj.values = {'item1': data1}and your data will be pickeld automatically.