Beispiel #1
0
    def insert_item(self, item):
        """
        Inserts a POI item into the data store
        :param item: XML Element with the required fields
        """
        c_name = item.find('name').text
        c_address = item.find('address').text
        c_latitude = item.find('latitude').text
        c_longitude = item.find('longitude').text
        c_open = item.find('open').text
        c_close = ''
        c_website = item.find('website').text
        c_category_id = self.request.get('category_id').encode('utf-8')
        c_description = ''
        c_days = '0'

        ancestor_key = ndb.Key("FIContent_v1", "POI")
        p = POI(parent=ancestor_key, name=c_name, categoryID=int(c_category_id), lat=float(c_latitude),
                lon=float(c_longitude), description=c_description, open=c_open, close=c_close, days=int(c_days),
                address=c_address, website=c_website)
        p.put()