I have about 42,000 lines in a database that I need imported into my Django database. I made a PHP script that outputs the data like o:
Base.objects.get_or_create(identifier="92NC", local="92NC", type=5, elevation="1178", iata="", name="Grace Hospital Heliport",country="United States", region="North Carolina", municipality="Morganton", location=Point(-81.65, 35.73)) Base.objects.get_or_create(identifier="92NH", local="92NH", type=5, elevation="720", iata="", name="Morrison Heliport",country="United States", region="New Hampshire", municipality="Meredith", location=Point(-71.52, 43.68)) Base.objects.get_or_create(identifier="92NJ", local="92NJ", type=1, elevation="530", iata="", name="Flying D Farm Airport",country="United States", region="New Jersey", municipality="Kingwood Township", location=Point(-75, 40.47)) Base.objects.get_or_create(identifier="92NY", local="92NY", type=1, elevation="1430", iata="", name="Bloecher Farm Airport",country="United States", region="New York", municipality="Strykersville", location=Point(-78.46, 42.75)) Base.objects.get_or_create(identifier="92OI", local="92OI", type=5, elevation="825", iata="", name="Good Samaritan Hospital Heliport",country="United States", region="Ohio", municipality="Cincinnati", location=Point(-84.52, 39.14)) I then go into the django shell and just type "from data import *", and it executes all the lines. This works fine, except for the fact that "identifier" is set as primary key, and every few thousand or so lines a duplicate identifier pops up which causes it to error out. I'd like to just throw those ones out and let the duplicates be ignored. Anyone know how to do this? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---