Changes between Version 4 and Version 5 of S3/S3Hierarchy
- Timestamp:
- 05/21/14 19:59:57 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
S3/S3Hierarchy
v4 v5 35 35 == Data Model == 36 36 37 To store a hierarchical taxonomy, the database table must include a parent reference (self-reference). 37 To store a hierarchical taxonomy, the database table must include a parent reference (self-reference). This can either be a foreign key to the table, or - if the table is a super-entity instance - a (second) reference to the super-entity. 38 38 39 Th is can either be a foreign key to the table, or - if the table is a super-entity instance - a (second) reference to the super-entity. The diagrams below explain the two models.39 The diagrams explain the two models: 40 40 41 41 [[Image(hierarchy_data_model.png)]] 42 43 == Configuration == 44 45 The hierarchy is configured in the model as the field name of the parent reference: 46 47 {{{#!python 48 self.configure(tablename, hierarchy="parent") 49 }}} 50 51 If categories (e.g. level) are to be used, the hierarchy is configured as tuple of parent reference and category field: 52 53 {{{#!python 54 self.configure(tablename, hierarchy=("parent", "level")) 55 }}} 56 57 == Connecting to the Hierarchy == 58 59 - ''tbw''