~openerp-dev/openobject-doc/trunk

« back to all changes in this revision

Viewing changes to i18n/ro/source/developer/2_5_Objects_Fields_Methods/object_inherits.rst

  • Committer: Antony Lesuisse
  • Date: 2010-03-05 16:46:40 UTC
  • Revision ID: al@openerp.com-20100305164640-9b7anc1t5ujha8lw
Merge doc into feature, before deletion of both features and doc. (odo)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
.. i18n: Inheritance by Delegation - _inherits
 
3
.. i18n: =====================================
 
4
..
 
5
 
 
6
Inheritance by Delegation - _inherits
 
7
=====================================
 
8
 
 
9
.. i18n:  **Syntax :** ::
 
10
.. i18n: 
 
11
.. i18n:   class tiny_object(osv.osv)
 
12
.. i18n:       _name = 'tiny.object'
 
13
.. i18n:       _table = 'tiny_object'
 
14
.. i18n:       _inherits = { 'tiny.object'_1_ : name_col'_1_', 
 
15
.. i18n:                     'tiny.object'_2_ : name_col'_2_', ...,
 
16
.. i18n:                     'tiny.object'_n_ : name_col'_n_' }
 
17
.. i18n:       (...)
 
18
..
 
19
 
 
20
 **Syntax :** ::
 
21
 
 
22
  class tiny_object(osv.osv)
 
23
      _name = 'tiny.object'
 
24
      _table = 'tiny_object'
 
25
      _inherits = { 'tiny.object'_1_ : name_col'_1_', 
 
26
                    'tiny.object'_2_ : name_col'_2_', ...,
 
27
                    'tiny.object'_n_ : name_col'_n_' }
 
28
      (...)
 
29
 
 
30
.. i18n: The object 'tiny.object' inherits from all the columns and all the methods from the n objects 'tiny.object'_1_, ..., 'tiny.object'_n_.
 
31
..
 
32
 
 
33
The object 'tiny.object' inherits from all the columns and all the methods from the n objects 'tiny.object'_1_, ..., 'tiny.object'_n_.
 
34
 
 
35
.. i18n: To inherit from multiple tables, the technique consists in adding one column to the table tiny_object per inherited object. This column will store a foreign key (an id from another table). The values *name_col'_1_' name_col'_2_' ... name_col'_n_'* are of type string and determine the title of the columns in which the foreign keys from 'tiny.object'_1_, ..., 'tiny.object'_n_ are stored.
 
36
..
 
37
 
 
38
To inherit from multiple tables, the technique consists in adding one column to the table tiny_object per inherited object. This column will store a foreign key (an id from another table). The values *name_col'_1_' name_col'_2_' ... name_col'_n_'* are of type string and determine the title of the columns in which the foreign keys from 'tiny.object'_1_, ..., 'tiny.object'_n_ are stored.
 
39
 
 
40
.. i18n: This inheritance mechanism is usually called " *instance inheritance* "  or  " *value inheritance* ". A resource (instance) has the VALUES of its parents. 
 
41
..
 
42
 
 
43
This inheritance mechanism is usually called " *instance inheritance* "  or  " *value inheritance* ". A resource (instance) has the VALUES of its parents.