fetchModelInfo
Overview
Fetches the model info for an app and model, and caches it in infos.
A cached result resolves at once, and a cached error rejects at once. A request already in flight for the same model is shared. The response keys are converted to camelCase, and pk is set to the name of the primary key field.
Signature
fetchModelInfo(args)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| args | object | yes | The model to fetch info for. |
args Properties
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| app | string | Django app label. | ||
| model | string | Model name. |
Returns
any
A promise for the model info. It rejects with ModelInfoError when the request fails, and with AuthScopeInvalidatedError if the authenticated user changes while it is in flight. It rejects with a plain Error when app or model is missing or when the response has no primary key field.
Source
client/lib/stores/storeModelInfo.js:346