isReverseForeignKey
Overview
Report whether a field is a reverse foreign key, such as an order's items when each item has a foreign key to its order.
A form sends an unexpanded reverse foreign key as a list of primary keys. The server applies that list with the related manager's set(). When the foreign key is not nullable, set() only adds rows, so selecting another parent's row moves it to this parent and removing a row from the list removes nothing. Forms therefore show the field read-only, and create and update views leave it out of the default submitFields. A view that names the field in expand edits its rows as an inline instead.
Signature
isReverseForeignKey(field)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| field | FieldInfo | yes | The field's model info. |
Returns
boolean
Whether model info describes the field as a reverse foreign key.
Source
client/lib/utils/reverseForeignKey.js:14