2
0
mirror of https://github.com/opnsense/docs synced 2024-10-30 21:20:20 +00:00

Update models_fieldtypes.rst - Add example to display multiple fields

This commit is contained in:
Monviech 2024-04-05 13:38:01 +02:00 committed by GitHub
parent 040d2bdffe
commit bb39d6eac8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -391,6 +391,21 @@ Define relations to other nodes in the model, such as to point the attribute :co
</Model>
</pipe>
To display multiple fields, the :code:`display_format` is required.
.. code-block:: xml
<pipe type="ModelRelationField">
<Model>
<pipes>
<source>OPNsense.TrafficShaper.TrafficShaper</source>
<items>pipes.pipe</items>
<display>number,description</display>
<display_format>%s - %s</display_format>
</pipes>
</Model>
</pipe>
.. csv-table:: ModelRelationField
:header: "Parameter", "Options", "Purpose"
:widths: 30, 20, 40