Exemple #1
0
    def handle(self, countryNameKey, areaNameKey):
        country = Country.get_by_id(self.helper.getNormalisedCountryName(countryNameKey))
        if country is None:
            raise PageNotFoundException()

        area = country.getAreaForName(areaNameKey)
        if area is None:
            raise PageNotFoundException()

        return {
            "subtemplate": self.resolveTemplatePath("area.html"),
            "title": "Shark Attack Data: %s, %s" % (area.name, country.name),
            "country": country,
            "area": area,
            "breadcrumb_data": self.getBreadcrumbData(area),
            "meta_description": "A complete list of the shark attacks that have occurred in %s, %s." % (area.name, country.name)
            }
Exemple #2
0
 def onGet(self, countryNameKey):
     self._country = Country.get_by_id(self.helper.getNormalisedCountryName(countryNameKey))
     if self._country is None:
         return
     self._areas = [y for y in Area.query(ancestor=self._country.key).fetch()]