Changes between Version 9 and Version 10 of BluePrintIncidentReporting


Ignore:
Timestamp:
08/23/10 14:30:22 (14 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BluePrintIncidentReporting

    v9 v10  
    140140The back-end should NOT be easily customised as otherwise it is hard to share data between instances.
    141141
    142 Proposal: change to something more like this (doesn't yet handle the mapping - needs work!):
     142== Proposal ==
     143
     144Change to something more like this (doesn't yet handle the mapping - needs work!):
     145
    143146{{{
    144147irs_incident_type_opts = Storage (
     
    157160 * Q: Should .represent also be modified for Display of records?
    158161
     162== Proposal (nursix) ==
     163
     164a) keep the original dict, but change the values of the dict into tuples like:
     165{{{
     166irs_incident_type_opts = {
     167        101: ("roadway.bridgeClosure", T("Broken Road")),
     168}
     169}}}
     170b) make the .represent towards normal users show the second item in the tuple
     171rather than the first (easy tweak), while admin users may see both (the
     172controller can switch between those two)
     173
     174c) have a admin-only-accessible DB table irs_incident_type_opts with the
     175options available for the "normal" user like:
     176{{{
     177define_table("irs_incident_type_opts",
     178             Field("code", "integer", requires=IS_IN_SET(irs_incident_type_opts)))
     179}}}
     180d) In the model, make .requires the normal IS_IN_SET (To allow Sync of records with any of the options):
     181{{{
     182.requires = IS_IN_SET(irs_incident_type_opts)
     183}}}
     184f) In the controller, if "normal" user, override this requires by:
     185{{{
     186allowed_options = [opt.code for opt in db().select(db.irs_incident_type_opts.code)]
     187.requires = IS_IN_SET(allowed_opts)
     188}}}
     189
     190== Questions ==
     191
    159192Where there are hierarchies (such as roadway.roadwayClosure) provide a JS widget to split this into a hierarchical selector.
    160193