.. _tutorial-module-view: Display records =============== Having records in the database is nice but we want the user to manage this records through the user interface. In order to denote that a model can be displayed in the interface, you have to inherit from :class:`~trytond.model.ModelView`: .. code-block:: python from trytond.model import ModelSQL, ModelView ... class Opportunity(ModelSQL, ModelView): ... When you inherit from :class:`~trytond.model.ModelView`, your model gains the methods required to display the data on Tryton clients. Those methods allow to retrieve the fields and the definition of the views used by a model, to apply attributes on view elements and they also provide all the machinery for :ref:`on_change ` and :ref:`on_change_with `. Tryton Views ------------ In Tryton data can be displayed using different kind of views. The available view types and it's attributes are listed on the :ref:`Views ` topic. Tryton views are usual Tryton records that are persisted into the database. This design choice means that views are extendable and that you can use the traditional Tryton concepts when interacting with them. Define views ------------ Views are defined in XML_ files and they contain one XML tag for each element displayed in the view. The root tag of the view defines the view type. An example view for our opportunity module will be as follows: Here is the content of the form view of opportunity in :file:`view/opportunity_form.xml`: .. code-block:: xml