예제 #1
0
 def get_station_address(self, record):
     address = format_polling_station_address([
         getattr(record, field).strip()
         for field in self.station_address_fields
         if getattr(record, field).strip()
     ])
     return address
 def get_station_address(self, record):
     return format_polling_station_address([
         record.col37.strip(),
         record.col38.strip(),
         record.col39.strip(),
         record.col40.strip(),
         record.col41.strip(),
     ])
 def get_station_address(self, record):
     return format_polling_station_address([
         record.address_line1.strip(),
         record.address_line2.strip(),
         record.address_line3.strip(),
         record.address_line4.strip(),
         record.address_line5.strip(),
     ])
예제 #4
0
 def get_station_address(self, record):
     return format_polling_station_address([
         record.col23.strip(),
         record.col24.strip(),
         record.col25.strip(),
         record.col26.strip(),
         record.col27.strip(),
     ])
 def get_station_address(self, record):
     return format_polling_station_address([
         record.col7.strip(),
         record.col8.strip(),
         record.col9.strip(),
         record.col10.strip(),
         record.col11.strip(),
         record.col12.strip(),
     ])
예제 #6
0
 def get_station_address(self, record):
     return format_polling_station_address([
         record.placename.strip(),
         record.placeadd1.strip(),
         record.placeadd2.strip(),
         record.placeadd3.strip(),
         record.placeadd4.strip(),
         record.placeadd5.strip(),
     ])
예제 #7
0
 def get_station_address(self, record):
     return format_polling_station_address([
         record.polling_station_name.strip(),
         record.polling_station_address1.strip(),
         record.polling_station_address2.strip(),
         record.polling_station_address3.strip(),
         record.polling_station_address4.strip(),
         record.polling_station_address5.strip(),
         record.polling_station_address6.strip(),
         record.polling_station_address7.strip(),
         record.polling_station_address8.strip(),
     ])
예제 #8
0
    def station_record_to_dict(self, record):

        address = format_polling_station_address(
            [getattr(record, self.station_name_field)] +
            [getattr(record, field) for field in self.address_fields])

        location = self.get_station_point(record)

        return {
            "internal_council_id": getattr(record,
                                           self.station_id_field).strip(),
            "postcode": getattr(record, self.postcode_field).strip(),
            "address": address,
            "location": location,
        }
예제 #9
0
 def station_record_to_dict(self, record):
     address_parts = [
         record.address1,
         record.address2,
         record.address3,
         record.address4,
     ]
     if record.address5:
         address_parts.append(record.address5)
     address = format_polling_station_address(address_parts)
     return {
         "internal_council_id": record.code,
         "postcode": record.postcode,
         "address": address,
         "location": self.get_station_point(record),
     }
예제 #10
0
    def station_record_to_dict(self, record):
        location = self.extract_geometry(
            record, self.geom_type, self.get_srid("stations")
        )

        address = format_polling_station_address(
            [
                record["pao"] if record["pao"] else "",
                record["street"] if record["street"] else "",
                record["locality"] if record["locality"] else "",
            ]
        )
        postcode = ""
        if record["postcode"]:
            postcode = record["postcode"].strip()

        if record["dual_stn"]:
            codes = self.extract_codes(record["dual_stn"])
        else:
            codes = [record["polling_district"].strip()]

        if (
            record["pao"] == "Stockwood Library"
            and record["polling_district"].strip() == "STWD"
        ):
            codes = ["STWE"]

        stations = []
        for code in codes:
            stations.append(
                {
                    "internal_council_id": code,
                    "postcode": postcode,
                    "address": address,
                    "location": location,
                }
            )
        return stations
 def get_station_address(self, record):
     return format_polling_station_address([
         record.polling_station.strip(),
         record.polling_station_address.strip(),
     ])