| Issue 7: | Agent Types importer does not keep ID the same as ccp_dump ID | |
| 1 person starred this issue and may be notified of changes. | Back to list |
The importer class for agent types let's Django create a ID for each agent
type which might not be the same as the id from the ccp_dump. Imports from
other tables then use this ID to link agent types which could result in the
wrong type to be associated.
Existing importer:
class Importer_agtAgentTypes(SQLImporter):
def import_row(self, row):
imp_obj, created =
AgtAgentType.objects.get_or_create(name=row['agentType'])
imp_obj.save()
|
Fix is as follows, I'll commit once some other issues are solved regarding primary and foreign keys: class Importer_agtAgentTypes(SQLImporter): def import_row(self, row): imp_obj, created = AgtAgentType.objects.get_or_create(id=row['agentTypeID']) imp_obj.name = name=row['agentType'] imp_obj.save()