Skip to content

Instantly share code, notes, and snippets.

@SuAlvarez
Created February 9, 2012 23:34
Show Gist options
  • Save SuAlvarez/1784263 to your computer and use it in GitHub Desktop.
Save SuAlvarez/1784263 to your computer and use it in GitHub Desktop.
from apps.consumer_end.models import Restaurant, RestaurantMenuCategory, RestaurantMenuItem
ifile = open('/Users/salvarez/desktop/Menu_Categories_New.csv', "rU")
reader = csv.DictReader(ifile)
for row in reader:
Restaurant.objects.filter(name=row['Restaurant'])
RestaurantMenuItem.objects.filter(restaurant=row['Restaurant'], name=row['Item'], price=row['Price'], category=row['Category'], description=row['Description'])
# rmc = RestaurantMenuCategory(title=row['Restaurant'])
# rmc.save()
rmi = RestaurantMenuItem(restaurant=row['Restaurant'], name=row['Item'], price=row['Price'], category=row['Category'], description=row['Description'])
rmi.save()
print '-------'
ifile.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment