Changes between Version 38 and Version 39 of DeveloperGuidelines/GIS


Ignore:
Timestamp:
06/18/11 13:08:18 (10 years ago)
Author:
Fran Boon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/GIS

    v38 v39  
    150150{{{models/03_gis.py}}}
    151151{{{
    152 gis_layer_types = ["newlayertype", "..."]
    153 gis_layer_newlayertype_subtypes = ["Subtype"]
    154 # Base table from which the rest inherit
    155 gis_layer = db.Table(db, "gis_layer", timestamp,
    156             #uuidstamp, # Layers like OpenStreetMap, Google, etc shouldn't sync
    157             Field("name", notnull=True, label=T("Name"), requires=IS_NOT_EMPTY(), comment=SPAN("*", _class="req")),
    158             Field("description", label=T("Description")),
    159             #Field("priority", "integer", label=T("Priority")),    # System default priority is set in ol_layers_all.js. User priorities are set in WMC.
    160             Field("enabled", "boolean", default=True, label=T("Available in Viewer?")))
    161 for layertype in gis_layer_types:
    162     resource = "layer_" + layertype
    163     tablename = "%s_%s" % (module, resource)
    164     # Create Type-specific Layer tables
    165     if layertype == "newlayertype":
    166         t = db.Table(db, table,
    167             gis_layer,
    168             Field("subtype", label=T("Sub-type"), requires = IS_IN_SET(gis_layer_newlayertype_subtypes, zero=None)),
    169             Field("layer_specific_option"))
    170         table = db.define_table(tablename, t, migrate=migrate)
     152_gis_layer_types = ["newlayertype", "..."]
     153table = db.define_table("gis_layer_newlayertype",
     154                            name_field(),
     155                            Field("description", label=T("Description")),
     156                            Field("enabled", "boolean", default=True, label=T("Available in Viewer?")),
     157                            Field("visible", "boolean", default=True,
     158                                  label=T("On by default? (only applicable to Overlays)")),
     159                            Field("url", label=T("Location"), requires = IS_NOT_EMPTY(),
     160                                  comment=DIV( _class="tooltip",
     161                                               _title="%s|%s" % (T("Location"),
     162                                                                 T("The URL to access the service.")))),
     163                            Field("version", length=32,
     164                                  label=T("Version"), default="1.1.1",
     165                                  requires=IS_IN_SET(["1.1.1", "1.3.0"], zero=None)),
     166                            Field("base", "boolean", default=False,
     167                                  label=T("Base Layer?")),
     168                            Field("transparent", "boolean", default=True,
     169                                  label=T("Transparent?")),
     170                            gis_opacity(),
     171                            role_required(),       # Single Role
     172                            #roles_permitted(),    # Multiple Roles (needs implementing in modules/s3gis.py)
     173                            migrate=migrate, *s3_timestamp())
    171174}}}
    172175