"""
Import COUNCIL
"""
import sys

from data_collection.management.commands import BaseShpShpImporter

class Command(BaseShpShpImporter):
    """
    Imports the Polling Station data from COUNCIL
    """
    council_id     = 'your_councilid'
    districts_name = 'name_without_.shp'
    stations_name  = 'your.shp'

    def district_record_to_dict(self, record):
        print 'District:', record
        sys.exit(1)
        return {
            'internal_council_id': record[0],
            'name': record[1],
        }

    def station_record_to_dict(self, record):
        print 'Station', record
        sys.exit(1)
        return {
            'internal_council_id': record.internal_id,
            'postcode'           : record.address.split(',')[-1],
            'address'            : "\n".join(record.address.split(',')[:-1]),
        }
    

@@ -675,20 +675,11 @@
 cord
-.internal_id
+%5B0%5D
 ,%0A  
@@ -721,29 +721,9 @@
 cord
-.address.split(',')%5B-
+%5B
 1%5D,%0A
@@ -761,50 +761,17 @@
   : 
-%22%5Cn%22.join(record.address.split(',')%5B:-1%5D),
+record%5B2%5D
 %0A   

Update Shape&Shape importer - shapes don't have named fields!