Choices for Foo?

The choices_for_FOO hook would allow a model to restrict the choices for a given field based on e.g. another field (common requirement where you have row-level authorization and need to restrict choices to the set of records accessible by the auth-row attached to this object).  It's currently a patch attached to a 5 year old recently re-opened ticket in Django.  There's a similar issue with ModelForms where they won't validate a unique_together if one of the two fields is omitted from the form (e.g. because you are implying the other field from context as part of row-level auth).  Sigh.


Comments are closed.


Pingbacks are closed.