dj.choices icon indicating copy to clipboard operation
dj.choices copied to clipboard

Mixed Choices (Constants With ORM Values)

Open systemsoverload opened this issue 11 years ago • 0 comments

Not an issue per se, but I have a unique case in which a handful of my models require a choices field to have some values from a model mixed in. I currently have a patch that allows this in a way that doesn't break backwards compatibility, the class accepts a model def and overrides iter to mix the values into the list.

I understand that this may be more of a one-off as making a model with a fixture would accomplish the same goal, but I was curious if there was any interest in this patch? Either way, really loving what you've done here, I am thankful to never have to use namedTuple, nested tuples, or my own DIY iterable solution that sucks!

systemsoverload avatar Mar 04 '14 17:03 systemsoverload