"""
Import Sheffield
"""
from data_collection.management.commands import BaseShpShpImporter

class Command(BaseShpShpImporter):
    """
    Imports the Polling Station data from Sheffield
    """
    council_id     = 'E08000019'
    districts_name = 'SCCPollingDistricts2015'
    stations_name  = 'SCCPollingStations2015.shp'

    def district_record_to_dict(self, record):
        return {
            'internal_council_id': record[0],
            'name': record[1],
        }

    def station_record_to_dict(self, record):

        address = record[1]

        # remove postcode from end of address if present
        postcode_offset = -len(record[2])
        if address[postcode_offset:] == record[2]:
            address = address[:postcode_offset].strip()

        # remove trailing comma if present
        if address[-1:] == ',':
            address = address[:-1]

        # replace commas with \n
        address = "\n".join(map(lambda x: x.strip(), address.split(',')))

        return {
            'internal_council_id': record[0],
            'postcode'           : record[2],
            'address'            : address
        }

@@ -410,32 +410,78 @@
 nal_council_id':
+ record%5B1%5D,%0A            'extra_id':           
  record%5B0%5D,%0A    
@@ -495,16 +495,31 @@
  'name':
+               
  record%5B
@@ -1186,16 +1186,63 @@
  address
+,%0A            'polling_district_id': record%5B-1%5D
 %0A       

Add polling_district_id in Sheffield import script