Changes between Version 13 and Version 14 of TaiwanSettings


Ignore:
Timestamp:
01/22/12 14:46:37 (10 years ago)
Author:
Fran Boon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TaiwanSettings

    v13 v14  
    2727== To Import Admin Names for Taiwan ==
    2828
    29 Usually this is the initial and one-time work. Enter the CLI environment to run commands:
    30 
     29Add this to your [BluePrint/PrePopulate Prepopulate] tasks.cfg:
    3130{{{
    32   $ python web2py.py -S eden -M
     31gis,location,TWL1.csv,location.xsl
     32gis,location,TWL2.csv,location.xsl
     33gis,location,TWL3.csv,location.xsl
    3334}}}
    34 
    35 Make sure `modules/s3gis.py` containing `utf8_csv_reader()`, which is included since [http://bazaar.launchpad.net/~flavour/sahana-eden/trunk/revision/1413 rev1413]. Place `L1.csv, L2.csv, L3.csv` in the top level of `web2py` directory.
    36 
    37 {{{
    38   >>> tablename = "gis_location"
    39   >>> table = db[tablename]
    40   # Example to look for a record's id
    41   >>> db(table.name == "Taiwan").select().first().id
    42   215
    43   # L0
    44   >>> db(table.name != "Taiwan").delete()
    45   # Here will show the number of deletion
    46   >>> db.commit()
    47   # L1
    48   >>> gis.import_csv("L1.csv")
    49   >>> db.commit()
    50   # L2
    51   >>> gis.import_csv("L2.csv")
    52   >>> db.commit()
    53   # L3
    54   >>> gis.import_csv("L3.csv")
    55   >>> db.commit()
    56   # Example to look for records matching a name
    57   >>> db.executesql("SELECT * FROM gis_location WHERE name = 'ε…‰εΎ©ι‡Œ' and level = 'L3'")
    58   # Here will show a list of 13 tuples. Use SELECT count(*) in the above statement to verify.
    59 }}}
    60 
    6135== To Enable OpenID Auth ==
    6236