コード例 #1
0
ファイル: mapAspects.py プロジェクト: sylvestre/indico
        'bottomRightLatitude': '46.295676244254715',
        'bottomRightLongitude': '6.115661859512329',
        'zoomLevel': 17,
        'defaultOnStartup': False
    },
    {
        'id': 6,
        'name': 'POINT 8',
        'centerLatitude': 46.24158691675184,
        'centerLongitude': 6.097038745847385,
        'topLeftLatitude': '46.2393607911537',
        'topLeftLongitude': '6.092873811721802',
        'bottomRightLatitude': '46.24381295202931',
        'bottomRightLongitude': '6.101188659667969',
        'zoomLevel': 17,
        'defaultOnStartup': False
    },
]

DBMgr.getInstance().startRequest()
Factory.getDALManager().connect()

location = Location.parse('CERN')

for aspectData in aspects:
    aspect = MapAspect()
    aspect.updateFromDictionary(aspectData)
    location.addAspect(aspect)

DBMgr.getInstance().endRequest()
コード例 #2
0
 def _getAnswer(self):
     aspect = MapAspect()
     aspect.updateFromDictionary(self._aspect)
     self._location.addAspect(aspect)
     return {}