Changes between Version 34 and Version 35 of S3/S3Model/SuperEntities


Ignore:
Timestamp:
04/01/14 12:21:34 (11 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3Model/SuperEntities

    v34 v35  
    101101
    102102{{{#!python
    103 tablename = "pr_presence"
    104 table = db.define_table(tablename,
    105                         super_link("pe_id", "pr_pentity"),
    106                         super_link("sit_id", "sit_situation"), # sit_id
    107                         ...)
     103tablename = "my_example"
     104define_table(tablename,
     105             super_link("pe_id", "pr_pentity"),
     106             super_link("sit_id", "sit_situation"),
     107             ...)
    108108}}}
    109109
     
    115115
    116116...or just type the field name (best option in models with lazy tables).
     117
     118{{{super_link()}}} allows overriding a number of field settings:
     119
     120{{{#!python
     121tablename = "my_example"
     122define_table(tablename,
     123             super_link("pe_id", "pr_pentity"),
     124             super_link("sit_id", "sit_situation",
     125                        label = ...,                # field label for CRUD forms
     126                        comment = ...,              # field comment for CRUD forms
     127                        represent = ...,            # representation method for field values
     128                        orderby = ...,              # orderby-expression for IS_ONE_OF
     129                        sort = ...,                 # alpha-sort options in IS_ONE_OF
     130                        filterby = ...,             # inclusive filter for IS_ONE_OF by field
     131                        filter_opts = ...,          # options for filter_by
     132                        not_filterby = ...,         # exclusive filter for IS_ONE_OF by field
     133                        not_filter_opts = ...,      # options for not_filterby
     134                        instance_types = ...,       # limit selection to certain instance types
     135                        realms = ...,               # limit selection to realms
     136                        updateable = ...,           # limit selection to updateable instances
     137                        groupby = ...,              # groupby for IS_ONE_OF
     138                        script = ...,               # script for selector widget
     139                        widget = ...,               # selector widget
     140                        empty = ...,                # allow field to be None
     141                        default = ...,              # default value for the field
     142                        ondelete = "CASCADE",       # ondelete option for the field
     143                        readable = False,           # field is readable in CRUD forms
     144                        writable = False,           # field is writable in CRUD forms
     145                        ),
     146             ...)
     147}}}
    117148=== Updating a Super-Entity ===
    118149