Changes between Version 2 and Version 3 of S3/S3Profile


Ignore:
Timestamp:
05/12/14 11:50:10 (11 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3Profile

    v2 v3  
    2424== Configuration ==
    2525The profile pages are configured by configuring a few profile_* variables and storing these against the tablename with the usual {{{s3db.configure(tablename, key=value)}}}, e.g.:
    26 {{{
     26{{{#!python
    2727s3db.configure(tablename,
    2828               profile_title = title,
     
    4848* {{{profile_widgets}}} are the Widgets (see below)
    4949* {{{profile_layers}}} are additional layers to display on the map, defined like:
    50 {{{
     50{{{#!python
    5151layer = dict(name = record_name,
    5252             id = "profile-header-%s-%s" % (tablename, record_id),
     
    6161=== Widget configuration ===
    6262Here is an example configuration for a map widget:
    63 {{{
     63{{{#!python
    6464map_widget = dict(label = "Map",
    6565                  type = "map",
     
    7979
    8080Here is an example configuration for a datalist widget:
    81 {{{
     81{{{#!python
    8282alerts_widget = dict(label = "Alerts",
    8383                     label_create = "Create Alert",
     
    9999
    100100NB You should ensure that your create forms establish the context link automatically. This is usually done by checking for a context filter, and then setting table.field.default, e.g.:
    101 {{{
     101{{{#!python
    102102incident_id = get_vars.get("~.(incident)", None)
    103103if incident_id:
     
    108108
    109109If the link is via a link table then you need to add the link onaccept, e.g.:
    110 {{{
     110{{{#!python
    111111incident_id = r.get_vars.get("~.(incident)", None)
    112112if incident_id:
     
    126126
    127127The hook to link the 'profile' method to this class is in {{{s3_rest_controller()}}} in {{{models/00_utils.py}}}:
    128 {{{
     128{{{#!python
    129129set_handler("profile", s3base.S3Profile)
    130130}}}
     
    156156* Allow component resources to be filtered
    157157* Comments widget
     158* Use widget() function of target method handler instead of internal widgets
    158159
    159160== See Also ==