Skip to content

Instantly share code, notes, and snippets.

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