Changes between Version 28 and Version 29 of S3/S3Model/SuperEntities


Ignore:
Timestamp:
03/03/14 10:48:47 (8 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3Model/SuperEntities

    v28 v29  
    4444
    4545Shared fields will mirror the values from the respective instance record, which allows easy access without need to join multiple tables.
    46 
    47 If the names of shared fields are different in certain instance tables, you can define a field mapping when you configure the instance table (continuing the example from above):
    48 
    49 {{{#!python
    50 
    51         # Define the instance table
    52         tablename = "my_instance_table"
    53         table = self.define_table(tablename,
    54                                   Field("first_date", "datetime"),
    55                                   Field("last_date", "datetime"),
    56                                   *s3_meta_fields())
    57 
    58         # Configure the instance table
    59         self.configure("my_instance_table",
    60                        # Configure the super entity
    61                        super_entity = "my_super_entity",
    62                        # Map the "first_date" field in my_instance_table to "start_date" in my_super_entity
    63                        my_super_entity_fields = {"start_date": "first_date"},
    64                   )
    65 
    66 }}}
    6746=== Defining an Instance of a Super-Entity ===
    6847