Changes between Version 4 and Version 5 of S3/S3Hierarchy


Ignore:
Timestamp:
05/21/14 19:59:57 (10 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3Hierarchy

    v4 v5  
    3535== Data Model ==
    3636
    37 To store a hierarchical taxonomy, the database table must include a parent reference (self-reference).
     37To 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.
    3838
    39 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. The diagrams below explain the two models.
     39The diagrams explain the two models:
    4040
    4141[[Image(hierarchy_data_model.png)]]
     42
     43== Configuration ==
     44
     45The 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
     51If 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''