author | Alexandre Fayolle <alexandre.fayolle@logilab.fr> |
Fri, 12 Feb 2010 12:57:14 +0100 | |
branch | stable |
changeset 4555 | 8968c50818db |
parent 3257 | 0d953f0b41c4 |
permissions | -rw-r--r-- |
2393
6190852af97f
[doc] add list of dependencies in appendix
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1714
diff
changeset
|
1 |
|
6190852af97f
[doc] add list of dependencies in appendix
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1714
diff
changeset
|
2 |
Inheritance |
6190852af97f
[doc] add list of dependencies in appendix
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1714
diff
changeset
|
3 |
----------- |
6190852af97f
[doc] add list of dependencies in appendix
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1714
diff
changeset
|
4 |
|
2539
0f26a76b0348
[doc] some more rewriting
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2393
diff
changeset
|
5 |
When describing a data model, entities can inherit from other entities as is |
0f26a76b0348
[doc] some more rewriting
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2393
diff
changeset
|
6 |
common in object-oriented programming. |
0f26a76b0348
[doc] some more rewriting
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
2393
diff
changeset
|
7 |
|
3257
0d953f0b41c4
[D] add entity inheritance example
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
2539
diff
changeset
|
8 |
You have the possibility to adapt some entity attributes, as follow: |
0d953f0b41c4
[D] add entity inheritance example
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
2539
diff
changeset
|
9 |
|
0d953f0b41c4
[D] add entity inheritance example
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
2539
diff
changeset
|
10 |
.. sourcecode:: python |
0d953f0b41c4
[D] add entity inheritance example
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
2539
diff
changeset
|
11 |
|
0d953f0b41c4
[D] add entity inheritance example
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
2539
diff
changeset
|
12 |
from cubes.OTHER_CUBE import entities |
0d953f0b41c4
[D] add entity inheritance example
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
2539
diff
changeset
|
13 |
class EntityExample(entities.EntityExample): |
0d953f0b41c4
[D] add entity inheritance example
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
2539
diff
changeset
|
14 |
def dc_long_title(self): |
0d953f0b41c4
[D] add entity inheritance example
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
2539
diff
changeset
|
15 |
return '%s (%s)' % (self.name, self.description) |
0d953f0b41c4
[D] add entity inheritance example
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
2539
diff
changeset
|
16 |
|
0d953f0b41c4
[D] add entity inheritance example
Julien Jehannet <julien.jehannet@logilab.fr>
parents:
2539
diff
changeset
|
17 |
|
2393
6190852af97f
[doc] add list of dependencies in appendix
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents:
1714
diff
changeset
|
18 |
XXX WRITME |