equal
deleted
inserted
replaced
1 .. -*- coding: utf-8 -*- |
1 .. -*- coding: utf-8 -*- |
2 |
2 |
3 |
3 |
4 Stored data handling |
4 Data as objects |
5 ==================== |
5 =============== |
|
6 |
|
7 We will in this chapter introduce the objects that are used to handle |
|
8 the data stored in the database. |
6 |
9 |
7 Classes `Entity` and `AnyEntity` |
10 Classes `Entity` and `AnyEntity` |
8 -------------------------------- |
11 -------------------------------- |
9 |
12 |
10 To provide a specific behavior for each entity, we just need to define |
13 To provide a specific behavior for each entity, we just need to define |
11 a class inheriting from `cubicweb.entities.EnyEntity`. In genera, we have |
14 a class inheriting from `cubicweb.entities.AnyEntity`. In general, we have |
12 to defined those classes in a module of `entites` package of an application |
15 to defined those classes in a module of `entities` package of an application |
13 so that it will be available on both server and client side. |
16 so that it will be available on both server and client side. |
14 |
17 |
15 The class `AnyEntity` is loaded dynamically from the class `Entity` |
18 The class `AnyEntity` is loaded dynamically from the class `Entity` |
16 (`cubciweb.common.entity`). We define a sub-class to add methods or to |
19 (`cubciweb.common.entity`). We define a sub-class to add methods or to |
17 specialize the handling of a given entity type |
20 specialize the handling of a given entity type |