~chamindra/sahana-eden/frp3

« back to all changes in this revision

Viewing changes to models/zzz_1st_run.py

  • Committer: nursix.org
  • Date: 2010-02-15 00:36:02 UTC
  • mfrom: (609.1.1 frp)
  • Revision ID: dominic@nursix.org-20100215003602-22zwuwsifq47tn2l
Merge chamindra: Feature Class => Location Type

Show diffs side-by-side

added added

removed removed

Lines of Context:
357
357
            name = 'Zone',
358
358
        )
359
359
        db[table].insert(
 
360
            name = 'Orphenage',
 
361
        )
 
362
        db[table].insert(
360
363
            name = 'Incident',
361
364
        )
362
365
        db[table].insert(
363
 
            name = 'Shelter',
364
 
            marker_id = db(db.gis_marker.name=='shelter').select()[0].id,
365
 
            module = 'cr',
366
 
            resource = 'shelter'
367
 
        )
368
 
        db[table].insert(
369
 
            name = 'Office',
370
 
            marker_id = db(db.gis_marker.name=='office').select()[0].id,
371
 
            module = 'or',
372
 
            resource = 'office'
373
 
        )
374
 
        db[table].insert(
375
 
            name = 'Warehouse',
376
 
        )
377
 
        db[table].insert(
378
 
            name = 'Airport',
379
 
            marker_id = db(db.gis_marker.name=='airport').select()[0].id,
380
 
        )
381
 
        db[table].insert(
382
 
            name = 'Bridge',
383
 
            marker_id = db(db.gis_marker.name=='bridge').select()[0].id,
384
 
        )
385
 
        db[table].insert(
386
 
            name = 'Port',
387
 
            marker_id = db(db.gis_marker.name=='port').select()[0].id,
388
 
        )
389
 
        db[table].insert(
390
366
            name = 'Hospital',
391
367
            marker_id = db(db.gis_marker.name=='hospital').select()[0].id,
392
368
        )
393
 
        db[table].insert(
394
 
            name = 'Church',
395
 
            marker_id = db(db.gis_marker.name=='church').select()[0].id,
396
 
        )
397
 
        db[table].insert(
398
 
            name = 'School',
399
 
            marker_id = db(db.gis_marker.name=='school').select()[0].id,
400
 
        )
401
 
        db[table].insert(
402
 
            name = 'Food',
403
 
            marker_id = db(db.gis_marker.name=='food').select()[0].id,
404
 
        )
405
 
        db[table].insert(
406
 
            name = 'Water',
407
 
            marker_id = db(db.gis_marker.name=='water').select()[0].id,
408
 
        )
409
 
        db[table].insert(
410
 
            name = 'SMS',
411
 
            marker_id = db(db.gis_marker.name=='phone').select()[0].id,
412
 
        )
 
369
#        db[table].insert(
 
370
#            name = 'Shelter',
 
371
#            marker_id = db(db.gis_marker.name=='shelter').select()[0].id,
 
372
#            module = 'cr',
 
373
#            resource = 'shelter'
 
374
#        )
 
375
#        db[table].insert(
 
376
#            name = 'Office',
 
377
#            marker_id = db(db.gis_marker.name=='office').select()[0].id,
 
378
#            module = 'or',
 
379
#            resource = 'office'
 
380
#        )
 
381
#        db[table].insert(
 
382
#            name = 'Warehouse',
 
383
#        )
 
384
#        db[table].insert(
 
385
#            name = 'Airport',
 
386
#            marker_id = db(db.gis_marker.name=='airport').select()[0].id,
 
387
#        )
 
388
#        db[table].insert(
 
389
#            name = 'Bridge',
 
390
#            marker_id = db(db.gis_marker.name=='bridge').select()[0].id,
 
391
#        )
 
392
#        db[table].insert(
 
393
#            name = 'Port',
 
394
#            marker_id = db(db.gis_marker.name=='port').select()[0].id,
 
395
#        )
 
396
#
 
397
#        db[table].insert(
 
398
#            name = 'Church',
 
399
#            marker_id = db(db.gis_marker.name=='church').select()[0].id,
 
400
#        )
 
401
#        db[table].insert(
 
402
#            name = 'School',
 
403
#            marker_id = db(db.gis_marker.name=='school').select()[0].id,
 
404
#        )
 
405
#        db[table].insert(
 
406
#            name = 'Food',
 
407
#            marker_id = db(db.gis_marker.name=='food').select()[0].id,
 
408
#        )
 
409
#        db[table].insert(
 
410
#            name = 'Water',
 
411
#            marker_id = db(db.gis_marker.name=='water').select()[0].id,
 
412
#        )
 
413
#        db[table].insert(
 
414
#            name = 'SMS',
 
415
#            marker_id = db(db.gis_marker.name=='phone').select()[0].id,
 
416
#        )
413
417
 
414
418
    table = 'gis_feature_group'
415
419
    if not db(db[table].id).count():
447
451
        #    feature_class_id = db(db.gis_feature_class.name == 'Town').select()[0].id,
448
452
        #)
449
453
        db[table].insert(
450
 
            feature_group_id = db(db.gis_feature_group.name == 'Transport').select()[0].id,
451
 
            feature_class_id = db(db.gis_feature_class.name == 'Airport').select()[0].id,
452
 
        )
453
 
        db[table].insert(
454
 
            feature_group_id = db(db.gis_feature_group.name == 'Transport').select()[0].id,
455
 
            feature_class_id = db(db.gis_feature_class.name == 'Bridge').select()[0].id,
456
 
        )
457
 
        db[table].insert(
458
 
            feature_group_id = db(db.gis_feature_group.name == 'Transport').select()[0].id,
459
 
            feature_class_id = db(db.gis_feature_class.name == 'Port').select()[0].id,
460
 
        )
461
 
        db[table].insert(
462
454
            feature_group_id = db(db.gis_feature_group.name == 'Hospitals').select()[0].id,
463
455
            feature_class_id = db(db.gis_feature_class.name == 'Hospital').select()[0].id,
464
456
        )
465
 
        db[table].insert(
466
 
            feature_group_id = db(db.gis_feature_group.name == 'Infrastructure').select()[0].id,
467
 
            feature_class_id = db(db.gis_feature_class.name == 'Church').select()[0].id,
468
 
        )
469
 
        db[table].insert(
470
 
            feature_group_id = db(db.gis_feature_group.name == 'Infrastructure').select()[0].id,
471
 
            feature_class_id = db(db.gis_feature_class.name == 'School').select()[0].id,
472
 
        )
473
 
        db[table].insert(
474
 
            feature_group_id = db(db.gis_feature_group.name == 'Programme').select()[0].id,
475
 
            feature_class_id = db(db.gis_feature_class.name == 'Food').select()[0].id,
476
 
        )
477
 
        db[table].insert(
478
 
            feature_group_id = db(db.gis_feature_group.name == 'Programme').select()[0].id,
479
 
            feature_class_id = db(db.gis_feature_class.name == 'Water').select()[0].id,
480
 
        )
481
 
        db[table].insert(
482
 
            feature_group_id = db(db.gis_feature_group.name == 'Offices').select()[0].id,
483
 
            feature_class_id = db(db.gis_feature_class.name == 'Office').select()[0].id,
484
 
        )
485
 
        db[table].insert(
486
 
            feature_group_id = db(db.gis_feature_group.name == 'SMS Alerts').select()[0].id,
487
 
            feature_class_id = db(db.gis_feature_class.name == 'SMS').select()[0].id,
488
 
        )
 
457
#
 
458
#        db[table].insert(
 
459
#            feature_group_id = db(db.gis_feature_group.name == 'Transport').select()[0].id,
 
460
#            feature_class_id = db(db.gis_feature_class.name == 'Airport').select()[0].id,
 
461
#        )
 
462
#        db[table].insert(
 
463
#            feature_group_id = db(db.gis_feature_group.name == 'Transport').select()[0].id,
 
464
#            feature_class_id = db(db.gis_feature_class.name == 'Bridge').select()[0].id,
 
465
#        )
 
466
#        db[table].insert(
 
467
#            feature_group_id = db(db.gis_feature_group.name == 'Transport').select()[0].id,
 
468
#            feature_class_id = db(db.gis_feature_class.name == 'Port').select()[0].id,
 
469
#        )
 
470
#        db[table].insert(
 
471
#            feature_group_id = db(db.gis_feature_group.name == 'Infrastructure').select()[0].id,
 
472
#            feature_class_id = db(db.gis_feature_class.name == 'Church').select()[0].id,
 
473
#        )
 
474
#        db[table].insert(
 
475
#            feature_group_id = db(db.gis_feature_group.name == 'Infrastructure').select()[0].id,
 
476
#            feature_class_id = db(db.gis_feature_class.name == 'School').select()[0].id,
 
477
#        )
 
478
#        db[table].insert(
 
479
#            feature_group_id = db(db.gis_feature_group.name == 'Programme').select()[0].id,
 
480
#            feature_class_id = db(db.gis_feature_class.name == 'Food').select()[0].id,
 
481
#        )
 
482
#        db[table].insert(
 
483
#            feature_group_id = db(db.gis_feature_group.name == 'Programme').select()[0].id,
 
484
#            feature_class_id = db(db.gis_feature_class.name == 'Water').select()[0].id,
 
485
#        )
 
486
#        db[table].insert(
 
487
#            feature_group_id = db(db.gis_feature_group.name == 'Offices').select()[0].id,
 
488
#            feature_class_id = db(db.gis_feature_class.name == 'Office').select()[0].id,
 
489
#        )
 
490
#        db[table].insert(
 
491
#            feature_group_id = db(db.gis_feature_group.name == 'SMS Alerts').select()[0].id,
 
492
#            feature_class_id = db(db.gis_feature_class.name == 'SMS').select()[0].id,
 
493
#        )
489
494
    table = 'gis_apikey'
490
495
    if not db(db[table].id).count():
491
496
       db[table].insert(