A model represents a single business logic or concept. It contains fields and defines the behaviors of the record. Most of the time, each model stores records in a single database table.
This example defines a
Party model which has a
name and a
from trytond.model import ModelView, ModelSQL, fields class Party(ModelSQL, ModelView): "Party" __name__ = "party.party" name = fields.Char('Name') code = fields.Char('Code')
Model attributes define meta-information of the model. They are class attributes starting with an underscore. Some model properties are instance attributes allowing to update them at other places in the framework.