# Path: eve_db/ccp_importer/importers/importer_classes.py
# def parse_char_notnull(value):
#     '''
#     Takes a nullable char and converts it to empty char if null
#     '''
#     if value is not None:
#         return value
#     return ''


from eve_db.ccp_importer.importers.importer_classes import parse_char_notnull
from eve_db.models import *
from importer_classes import SQLImporter, parse_int_bool
                 ('description', 'description', parse_char_notnull))


def get_operation(operation_id):
    if operation_id:
        return StaOperation.objects.get_or_create(id=operation_id)[0]
    return None

class Importer_staStationTypes(SQLImporter):
    DEPENDENCIES = ['staOperations', 'invTypes']
    model = StaStationType
    pks = (('id', 'stationTypeID'),)
    field_map = (('dock_entry_x', 'dockEntryX'),
                 ('dock_orientation_x', 'dockOrientationX'),
                 ('dock_entry_y', 'dockEntryY'),
                 ('dock_orientation_y', 'dockOrientationY'),
                 ('dock_entry_z', 'dockEntryZ'),
                 ('dock_orientation_z', 'dockOrientationZ'),
                 ('office_slots', 'officeSlots'),
                 ('reprocessing_efficiency', 'reprocessingEfficiency'),
                 ('operation', 'operationID', get_operation),
                 ('is_conquerable', 'conquerable', parse_int_bool))


class Importer_staOperations(SQLImporter):
    DEPENDENCIES = ['staStationTypes']
    model = StaOperation
    pks = (('id', 'operationID'),)
    field_map = (('activity_id', 'activityID'),
                 ('name', 'operationName'),

# Path: eve_db/ccp_importer/importers/importer_classes.py
# def parse_char_notnull(value):
#     '''
#     Takes a nullable char and converts it to empty char if null
#     '''
#     if value is not None:
#         return value
#     return ''


# Path: eve_db/ccp_importer/importers/station.py
from eve_db.ccp_importer.importers.importer_classes import parse_char_notnull
from eve_db.models import *
from importer_classes import SQLImporter, parse_int_bool

                 ('description', 'description', parse_char_notnull))


def get_operation(operation_id):
    if operation_id:
        return StaOperation.objects.get_or_create(id=operation_id)[0]
    return None

class Importer_staStationTypes(SQLImporter):
    DEPENDENCIES = ['staOperations', 'invTypes']
    model = StaStationType
    pks = (('id', 'stationTypeID'),)
    field_map = (('dock_entry_x', 'dockEntryX'),
                 ('dock_orientation_x', 'dockOrientationX'),
                 ('dock_entry_y', 'dockEntryY'),
                 ('dock_orientation_y', 'dockOrientationY'),
                 ('dock_entry_z', 'dockEntryZ'),
                 ('dock_orientation_z', 'dockOrientationZ'),
                 ('office_slots', 'officeSlots'),
                 ('reprocessing_efficiency', 'reprocessingEfficiency'),
                 ('operation', 'operationID', get_operation),
                 ('is_conquerable', 'conquerable', parse_int_bool))


class Importer_staOperations(SQLImporter):
    DEPENDENCIES = ['staStationTypes']
    model = StaOperation
    pks = (('id', 'operationID'),)
    field_map = (('activity_id', 'activityID'),
                 ('name', 'operationName'),

                 ('description', 'description', parse_char_notnull),