Update models_fieldtypes.rst - Add example to display multiple fields (#551)

This commit is contained in:
Monviech 2024-04-05 14:40:09 +02:00 committed by GitHub
parent 040d2bdffe
commit 94ee5e68e6
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