Django - how can I have a field in my model consisting of tuple of integers?
Depends on how you intend to use them after storing in the database; 2 methods I can think of are:
Option 1)
models.IntegerField(unique=True)
now the trick is loading data and parsing it: you would have to concatenate the numbers then have a way to split them back out.
fast would be
Option 2)
models.CommaSeparatedIntegerField(max_length=1024, unique=True)
not sure how it handles unique values; likely '20,40' is not equal to '40,20', so those two sets would be unique.
or just implement it yourself in a custom field/functions in the model.
I am defining the models for my Django app, and I would like to have a field for a model consisting of a tuple of two (positive) integers.  How can I do this?  I'm looking at the Django Models API reference but I can't see any way of doing this.