~zubairassad89/sahana-eden/vms_gsoc

« back to all changes in this revision

Viewing changes to models/zzz_1st_run.py

  • Committer: Patricia Tressel
  • Date: 2010-08-15 13:34:25 UTC
  • mfrom: (768.1.211 eden)
  • Revision ID: tressel@phobos-20100815133425-z1eazm12k5pewg62
Merge from trunk, except for models/vol.py.

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
    if not db(table.id > 0).count():
84
84
        table.insert(
85
85
            admin_name = T("Sahana Administrator"),
86
 
            admin_email = T("support@Not Set"),
 
86
            admin_email = "support@Not Set",
87
87
            admin_tel = T("Not Set"),
88
88
            theme = 1
89
89
        )
587
587
            uuid = "www.sahanafoundation.org/GIS-FEATURE-CLASS-VOLUNTEER",
588
588
            name = "Volunteer",
589
589
            marker_id = db(db.gis_marker.name == "volunteer").select(limitby=(0, 1)).first().id,
590
 
            gps_marker = "volunteer",
 
590
            gps_marker = "Contact, Dreadlocks",
591
591
        )
592
592
        table.insert(
593
593
            uuid = "www.sahanafoundation.org/GIS-FEATURE-CLASS-WAREHOUSE",
618
618
        )
619
619
        table.insert(
620
620
            uuid = "www.sahanafoundation.org/GIS-FEATURE-GROUP-PROGRAMME",
621
 
            name = "Programme",
 
621
            name = "Programmes",
622
622
        )
623
623
        table.insert(
624
624
            uuid = "www.sahanafoundation.org/GIS-FEATURE-GROUP-HOSPITALS",
625
625
            name = "Hospitals",
626
626
        )
627
627
        table.insert(
 
628
            uuid = "www.sahanafoundation.org/GIS-FEATURE-GROUP-INCIDENTS",
 
629
            name = "Incidents",
 
630
        )
 
631
        table.insert(
628
632
            uuid = "www.sahanafoundation.org/GIS-FEATURE-GROUP-OFFICES",
629
633
            name = "Offices",
630
634
        )
669
673
            feature_class_id = db(db.gis_feature_class.name == "Hospital").select(db.gis_feature_class.id, limitby=(0, 1)).first().id,
670
674
        )
671
675
        table.insert(
 
676
            feature_group_id = db(db.gis_feature_group.name == "Incidents").select(db.gis_feature_group.id, limitby=(0, 1)).first().id,
 
677
            feature_class_id = db(db.gis_feature_class.name == "Incident").select(db.gis_feature_class.id, limitby=(0, 1)).first().id,
 
678
        )
 
679
        table.insert(
672
680
            feature_group_id = db(db.gis_feature_group.name == "Infrastructure").select(db.gis_feature_group.id, limitby=(0, 1)).first().id,
673
681
            feature_class_id = db(db.gis_feature_class.name == "Church").select(db.gis_feature_class.id, limitby=(0, 1)).first().id,
674
682
        )
677
685
            feature_class_id = db(db.gis_feature_class.name == "School").select(db.gis_feature_class.id, limitby=(0, 1)).first().id,
678
686
        )
679
687
        table.insert(
680
 
            feature_group_id = db(db.gis_feature_group.name == "Programme").select(db.gis_feature_group.id, limitby=(0, 1)).first().id,
 
688
            feature_group_id = db(db.gis_feature_group.name == "Programmes").select(db.gis_feature_group.id, limitby=(0, 1)).first().id,
681
689
            feature_class_id = db(db.gis_feature_class.name == "Food").select(db.gis_feature_class.id, limitby=(0, 1)).first().id,
682
690
        )
683
691
        table.insert(
684
 
            feature_group_id = db(db.gis_feature_group.name == "Programme").select(db.gis_feature_group.id, limitby=(0, 1)).first().id,
 
692
            feature_group_id = db(db.gis_feature_group.name == "Programmes").select(db.gis_feature_group.id, limitby=(0, 1)).first().id,
685
693
            feature_class_id = db(db.gis_feature_class.name == "Water").select(db.gis_feature_class.id, limitby=(0, 1)).first().id,
686
694
        )
687
695
        table.insert(
732
740
    if not db(table.id > 0).count():
733
741
        # Populate table
734
742
        for subtype in gis_layer_openstreetmap_subtypes:
735
 
            table.insert(
736
 
                    name = "OSM " + subtype,
737
 
                    subtype = subtype
738
 
                )
 
743
            if subtype in ["Taiwan"]:
 
744
                # Local OSM layers should be disabled by default in default builds
 
745
                table.insert(
 
746
                        name = "OSM " + subtype,
 
747
                        subtype = subtype,
 
748
                        enabled = False
 
749
                    )
 
750
            else:
 
751
                table.insert(
 
752
                        name = "OSM " + subtype,
 
753
                        subtype = subtype
 
754
                    )
739
755
    tablename = "gis_layer_google"
740
756
    table = db[tablename]
741
757
    if not db(table.id > 0).count():