[D] add entity inheritance example stable
authorJulien Jehannet <julien.jehannet@logilab.fr>
Wed, 16 Sep 2009 16:14:48 +0200
branchstable
changeset 3257 0d953f0b41c4
parent 3256 e39699c44299
child 3258 6536ee4f37f7
[D] add entity inheritance example
doc/book/en/development/datamodel/inheritance.rst
--- a/doc/book/en/development/datamodel/inheritance.rst	Tue Sep 15 17:43:56 2009 +0200
+++ b/doc/book/en/development/datamodel/inheritance.rst	Wed Sep 16 16:14:48 2009 +0200
@@ -5,4 +5,14 @@
 When describing a data model, entities can inherit from other entities as is
 common in object-oriented programming.
 
+You have the possibility to adapt some entity attributes, as follow:
+
+.. sourcecode:: python
+
+    from cubes.OTHER_CUBE import entities
+    class EntityExample(entities.EntityExample):
+        def dc_long_title(self):
+            return '%s (%s)' % (self.name, self.description)
+
+
 XXX WRITME