Open scott2b opened 2 years ago
Hmmm... how does Django and other ORMs handle this
We could let the user pass in a function.
It does introduce some challenges though. For example, we have to make sure Piccolo Admin keeps refetching the table schema just in case the choices have changed.
Also, would the function return a list of potential values, or an Enum.
maybe a dict of key: value's
Since choices takes an enum rather than a callable, it is not clear how one would provide choices dynamically. It would be ideal if we could provide dynamic choices so that, for example, the choices themselves could be stored in a table.