Created
March 6, 2010 15:08
-
-
Save wyattdanger/323728 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def main(): | |
import csv, sys, re | |
from pykk.message import site, db | |
from yourapp.apps.models import YourModel # import your relevant models | |
db.initialize() | |
reader = csv.DictReader(open(sys.argv[1])) | |
with db.transaction('Importing Employees'): | |
for row in reader: | |
# Go to town here | |
# To access a table row: row['Name of row'] | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment