-
Notifications
You must be signed in to change notification settings - Fork 0
/
customer.py
49 lines (49 loc) · 1.44 KB
/
customer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from pymongo import Connection
connection = Connection()
db = connection['warehouse8']
print "Connected to Database"
customer= db.customer
count = 1
for c in xrange(1,11):
for i in xrange(1,11):
for j in xrange(1,11):
record = {
"W_ID":c,
"D_ID":j,
"C_ID":i,
"C_FIRST_NAME":"Vikas"+str(i),
"C_MIDDLE_NAME":"Kumar",
"C_LAST_NAME":"Sherawat",
"C_STREET_1":"Street1",
"C_STREET_2":"Street2",
"C_CITY":"Delhi",
"C_STATE":"Delhi",
"C_ZIP":"110017",
"C_PHONE":"123476",
"C_SINCE":"2001",
"C_CREDIT":10,
"C_CREDIT_LIM":90,
"C_DISCOUNT":.15,
"C_BALANCE":500.0+count,
"C_YTD_PAYMENT":700.0,
"C_PAYMENT_CNT":34,
"C_DELIVERY_CNT":34,
"C_DATA":"random data",
"W_NAME":"W1",
"W_TAX":.05,
"W_STREET_1":"W_STREET_1",
"W_STREET_2":"W_STREET_2",
"W_CITY":"W_CITY",
"W_STATE":"W_STATE",
"W_ZIP":"W_ZIP",
"D_NAME":"D"+str(j),
"D_TAX":.03,
"D_STREET_1":"D_STREET_1",
"D_STREET_2":"D_STREET_2",
"D_CITY":"D_CITY",
"D_STATE":"D_STATE",
"D_ZIP":"D_ZIP"
}
ids = customer.insert(record)
print ids
count += 1