Changes between Version 10 and Version 11 of S3/S3Model/SuperEntities


Ignore:
Timestamp:
11/08/10 19:30:35 (14 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3Model/SuperEntities

    v10 v11  
    4141To make a table an instance of a super-entity, you can use {{{s3xrc.model.configure()}}}:
    4242
    43 In case your table uses different names for the shared fields, you can additionally set a field mapping:
     43{{{
     44s3xrc.model.configure(table,
     45    super_entity = db.sit_situation)
     46}}}
    4447
     48By default, all fields that the table and the super-entity have in common will be mirrored in the super-entity ("shared fields"). You can override this by specifying a list of fields to be mirrored by the super-entity.
     49
     50{{{
     51s3xrc.model.configure(table,
     52    super_entity = db.sit_situation,
     53    sit_situation_fields = ["datetime"])
     54}}}
     55
     56In case your table uses different names for the shared fields, you can use a dict instead to specify a mapping:
     57
     58{{{
     59s3xrc.model.configure(table,
     60    super_entity = db.sit_situation,
     61    sit_situation_fields = dict(datetime="timestmp", location_id="location_id"))
     62}}}
    4563=== Linking to a Super-Entity ===
    4664