Possibility to define explicit IDs
beniwohli opened this issue · 1 comments
While I love dj.choices, I have one issue that makes me wary of using it: the implicit integer ID, defined by the sequence of choices. The main problem I see with this is that somebody unaware of this implicit ID just adds choices in between already existing ones. End result: wrong data is displayed, and consequentially, becomes inconsistent. Same thing happens if the order of choices is changed for some reason.
Would it be feasible to add the possibility to define explicit IDs (that could also be strings, not necessarily integers)? Or is there another way to prevent the above scenarios?
Hey there, thanks for feedback! I actually see two separate issues here:
- The ability to maintain original choice IDs after updating the class.
- The ability to specify strings as IDs.
The former is very close to my heart, I thought hard of a good API to do it. I'm yet to find a solution that will integrate nicely with what I already have.
The latter issue looks simpler and totally makes sense as well, I will look into solving it soon.