This repository has been archived by the owner on Aug 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata.py
132 lines (99 loc) · 5.14 KB
/
data.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from db_setup import Base, Category, CatItem, User
engine = create_engine('sqlite:///catalog.db')
Base.metadata.bind = engine
DBSession = sessionmaker(bind=engine)
session = DBSession()
user1 = User(name='abdo', email='ar1813@fayoum.edu.eg')
category1 = Category(name="Basketball")
session.add(category1)
session.commit()
catItem1 = CatItem(title="Basketball ball ", description='''A basketball is a
spherical ball used in basketball games. Basketballs
typically range in size from very small promotional
items only a few inches in diameter to extra large balls
nearly a foot in diameter used in training exercises.
For example, a youth basketball could be 27 inches (69 cm)
in circumference, while a National Collegiate Athletic
Association (NCAA) men's ball would be a maximum of 30
inches (76 cm) and an NCAA women's ball would be a maximum
of 29 inches (74 cm)''',
category=category1, user=user1)
session.add(catItem1)
session.commit()
catItem3 = CatItem(title="Ring", description='''A backboard is a piece of
basketball equipment. It is a raised vertical board with
an attached basket consisting of a net suspended from a
hoop. It is made of a flat, rigid piece of, often Plexiglas
or tempered glass which also has the properties of safety
glass when accidentally shattered. It is usually
rectangular as used in NBA, NCAA and international
basketball. In recreational environments, a backboard may
be oval or a fan-shape, particularly in non-professional
games.''',
category=category1, user=user1)
session.add(catItem3)
session.commit()
category2 = Category(name="Volleyball")
session.add(category2)
session.commit()
catItem1 = CatItem(title="Volleyball ball", description='''A volleyball is a
ball used to play indoor volleyball, beach volleyball,
or other less common variations of the sport. Volleyballs
are round and traditionally consist of eighteen nearly
rectangular panels of synthetic or genuine leather, arranged
in six identical sections of three panels each, wrapped
around a bladder. However, in 2008, the FIVB adopted as its
official indoor ball a new Mikasa with dimples and only
eight panels for a softer touch and truer flight. A
valve permits the internal air pressure to be adjusted.''',
category=category2, user=user1)
session.add(catItem1)
session.commit()
catItem2 = CatItem(title="Volleyball Antenna", description='''An antenna is
placed on each side of the net perpendicular to the
sideline and is a vertical extension of the side boundary
of the court. A ball passing over the net must pass
completely between the antennae (or their theoretical
extensions to the ceiling) without contacting them''',
category=category2, user=user1)
session.add(catItem2)
session.commit()
catItem2 = CatItem(title="Volleyball Net", description=''' the high net that
separates the two teams and over which the volleyball must
pass''',
category=category2, user=user1)
session.add(catItem2)
session.commit()
#
category1 = Category(name="hockey")
session.add(category1)
session.commit()
catItem1 = CatItem(title="Hockey Stick", description='''A long-handled stick
with one curved end that is used in hockey.''',
category=category1, user=user1)
session.add(catItem1)
session.commit()
catItem1 = CatItem(title="Corner flag", description='''Each of the flags that
denotes the corner of the field of play.''',
category=category1, user=user1)
session.add(catItem1)
session.commit()
catItem1 = CatItem(title="Bibs", description="bib for protecting players ",
category=category1, user=user1)
session.add(catItem1)
session.commit()
catItem1 = CatItem(title="Hockey Kit bag", description='''A duffel bag, duffle
bag, or kit bag is a large cylindrical bag made of natural
or synthetic fabric, historically with a top closure using
a drawstring. Generally a duffel bag is used by
non-commissioned personnel in the military, and for
travel, sports and recreation by civilians. When used by
sailors or marines a duffel is known as a \"seabag\".
A duffel's open structure and lack of rigidity makes it
adaptable to carrying sports gear and similar bulky
objects''',
category=category1, user=user1)
session.add(catItem1)
session.commit()