fetchChoices
Overview
Fetches the choice list for a model field and stores it in choices.
A request already in flight for the same field is shared. A stored list does not stop a new request.
Signature
fetchChoices(app, model, field)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| app | string | yes | Django app label. |
| model | string | yes | Model name. |
| field | string | yes | Field name, converted to snake_case for the request. |
Returns
Promise
A promise for the server's paginated choice list. It rejects with ModelChoicesError when the request fails, and with AuthScopeInvalidatedError if the authenticated user changes while it is in flight.
Source
client/lib/stores/storeModelChoices.js:220