Created
May 20, 2016 02:24
-
-
Save raccoonyy/b1aa0c36bfcf2f207737b72efadcc0a4 to your computer and use it in GitHub Desktop.
실습용 데이터 생성
This file contains 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
from product.models import Product, OrderLog | |
animal = Product.objects.create(name='동물동요', price=8200) | |
pack = Product.objects.create(name='사운드북 패키지', price=38400) | |
abc = Product.objects.create(name='ABC Activity', price=9900) | |
import datetime | |
may1 = datetime.datetime(2016, 4, 1) | |
may2 = datetime.datetime(2016, 4, 2) | |
may3 = datetime.datetime(2016, 4, 3) | |
OrderLog.objects.bulk_create( | |
OrderLog(created=may1, product=abc), | |
OrderLog(created=may1, product=animal), | |
OrderLog(created=may1, product=pack), | |
OrderLog(created=may1, product=abc), | |
OrderLog(created=may1, product=animal), | |
OrderLog(created=may1, product=pack), | |
OrderLog(created=may2, product=pack), | |
OrderLog(created=may2, product=abc), | |
OrderLog(created=may2, product=abc), | |
OrderLog(created=may2, product=animal), | |
OrderLog(created=may2, product=abc), | |
OrderLog(created=may2, product=animal), | |
OrderLog(created=may3, product=animal), | |
OrderLog(created=may3, product=pack), | |
OrderLog(created=may3, product=animal), | |
OrderLog(created=may3, product=abc) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment