Пример #1
0
 def location_prefetch(self, l):
     '''
     Load adjoining locations
     '''
     for k,v in l.portal.items():
         if v not in self.locale:
             l = Location(database.get_doc("world", v))
             self.locale[l._id] = l
Пример #2
0
    def location_load(self, location_id):
        '''
        '''
        l = None
        if location_id not in self.locale:
            l = Location(database.get_doc("world", location_id))
            self.locale[l._id] = l
            self.location_prefetch(l)
        else:
            l = self.locale[location_id]

        return l