My favorites | Sign in
Project Home
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
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
Status:  Fixed
Owner:  AndreFMi...@gmail.com
Closed:  Apr 2010


 
Project Member Reported by AndreFMi...@gmail.com, Apr 30, 2010
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()


Apr 30, 2010
Project Member #1 AndreFMi...@gmail.com
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()


Status: Started
Apr 30, 2010
Project Member #2 AndreFMi...@gmail.com
Fixed in r50
Status: Fixed

Powered by Google Project Hosting