Skip to content

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 ​

NameTypeRequiredDescription
appstringyesDjango app label.
modelstringyesModel name.
fieldstringyesField 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