0
1
00:00:05,020 --> 00:00:07,030
<v ->Hello again in previous lecture what we did</v>
1

2
00:00:07,030 --> 00:00:10,720
we created our land book
2

3
00:00:10,720 --> 00:00:12,670
design right, its here
3

4
00:00:12,670 --> 00:00:14,540
and lets click for another one
4

5
00:00:14,540 --> 00:00:15,925
Lord Of The Rings
5

6
00:00:15,925 --> 00:00:16,760
as you see our book 
6

7
00:00:16,760 --> 00:00:17,593
name is here
7

8
00:00:17,593 --> 00:00:19,724
and also what we need to do
8

9
00:00:19,724 --> 00:00:21,850
we need to make a choice for our
9

10
00:00:21,850 --> 00:00:24,150
member right and land book
10

11
00:00:24,150 --> 00:00:25,810
what we need to do here, lets remove
11

12
00:00:25,810 --> 00:00:27,370
this column and that
12

13
00:00:27,370 --> 00:00:30,950
and also I want to move this button somewhere
13

14
00:00:30,950 --> 00:00:32,640
here on the left side okay
14

15
00:00:32,640 --> 00:00:34,520
and also what we need to do
15

16
00:00:34,520 --> 00:00:35,680
to do that
16

17
00:00:35,680 --> 00:00:38,620
here, I will go back to
17

18
00:00:38,620 --> 00:00:39,453
its here
18

19
00:00:39,453 --> 00:00:40,290
give book
19

20
00:00:41,350 --> 00:00:43,490
class is here for the button
20

21
00:00:44,480 --> 00:00:47,900
lets remove here, columns first
21

22
00:00:47,900 --> 00:00:50,310
that one is another one
22

23
00:00:50,310 --> 00:00:51,560
also for button
23

24
00:00:51,560 --> 00:00:54,680
x value will be 240 is fine I think
24

25
00:00:56,870 --> 00:00:59,700
and if run my application again now
25

26
00:00:59,700 --> 00:01:02,720
crime and punishment, is fine, maybe more
26

27
00:01:02,720 --> 00:01:04,970
10 pixels will be better
27

28
00:01:04,970 --> 00:01:08,210
so even 20 is fine now
28

29
00:01:08,210 --> 00:01:11,130
what I need to do, I need to create a function right
29

30
00:01:11,130 --> 00:01:13,940
for my, when I click, when I hit this button
30

31
00:01:13,940 --> 00:01:15,780
so I will say here, command
31

32
00:01:16,690 --> 00:01:18,020
equals
32

33
00:01:18,020 --> 00:01:19,063
lets say self.
33

34
00:01:21,010 --> 00:01:22,420
Lend
34

35
00:01:22,420 --> 00:01:23,253
book
35

36
00:01:23,253 --> 00:01:26,970
okay this is our definition name
36

37
00:01:26,970 --> 00:01:28,220
To do that what I need to do, I will create this
37

38
00:01:28,220 --> 00:01:29,910
definition and here I will say
38

39
00:01:32,770 --> 00:01:33,800
here
39

40
00:01:33,800 --> 00:01:35,248
def
40

41
00:01:35,248 --> 00:01:36,081
lendbook
41

42
00:01:37,380 --> 00:01:38,470
okay
42

43
00:01:38,470 --> 00:01:39,610
and here what I need  to do
43

44
00:01:39,610 --> 00:01:42,200
firstly I need to get my book name
44

45
00:01:42,200 --> 00:01:45,000
and also my member name right
45

46
00:01:45,000 --> 00:01:46,510
and here I will say book name
46

47
00:01:47,515 --> 00:01:48,570
variable
47

48
00:01:48,570 --> 00:01:49,403
equals self.
48

49
00:01:51,850 --> 00:01:53,320
Bookname.get okay
49

50
00:01:55,130 --> 00:01:56,481
bookname.get
50

51
00:01:56,481 --> 00:01:57,430
my variable name right
51

52
00:01:57,430 --> 00:02:00,211
and after that for member name
52

53
00:02:00,211 --> 00:02:01,311
I will say member name
53

54
00:02:02,840 --> 00:02:04,060
equals
54

55
00:02:04,060 --> 00:02:05,450
self. membername
55

56
00:02:06,331 --> 00:02:08,273
.get okay
56

57
00:02:08,273 --> 00:02:10,010
and now what I need to do
57

58
00:02:10,010 --> 00:02:11,970
I need here insert into
58

59
00:02:13,178 --> 00:02:15,640
my table right, this values
59

60
00:02:15,640 --> 00:02:17,220
which table
60

61
00:02:17,220 --> 00:02:18,070
let me run our, sorry
61

62
00:02:18,070 --> 00:02:19,680
let me
62

63
00:02:19,680 --> 00:02:21,630
go back to my database
63

64
00:02:22,650 --> 00:02:23,880
and here library
64

65
00:02:26,150 --> 00:02:27,740
our table name is
65

66
00:02:28,827 --> 00:02:30,030
its here borrows okay
66

67
00:02:30,990 --> 00:02:33,400
and fields for the borrow id is
67

68
00:02:33,400 --> 00:02:34,510
this is
68

69
00:02:34,510 --> 00:02:36,022
auto increment
69

70
00:02:36,022 --> 00:02:36,920
so we need to change
70

71
00:02:36,920 --> 00:02:40,140
b book id and also b member id right
71

72
00:02:40,140 --> 00:02:41,260
so here
72

73
00:02:41,260 --> 00:02:42,650
what I need to do
73

74
00:02:42,650 --> 00:02:44,073
I will say, if
74

75
00:02:44,073 --> 00:02:45,403
again,
75

76
00:02:46,551 --> 00:02:47,610
check okay
76

77
00:02:47,610 --> 00:02:49,070
if
77

78
00:02:49,070 --> 00:02:50,640
book name
78

79
00:02:50,640 --> 00:02:52,070
and
79

80
00:02:52,070 --> 00:02:52,903
member name
80

81
00:02:54,260 --> 00:02:56,410
not equals
81

82
00:02:56,410 --> 00:02:57,910
none okay
82

83
00:02:57,910 --> 00:03:01,170
and here I will say try first
83

84
00:03:01,170 --> 00:03:02,480
and after that except
84

85
00:03:03,664 --> 00:03:06,320
for except lets say for now pass okay
85

86
00:03:06,320 --> 00:03:07,420
for try what I will do
86

87
00:03:08,496 --> 00:03:09,387
I will say
87

88
00:03:09,387 --> 00:03:11,310
enter, create my query first
88

89
00:03:11,310 --> 00:03:13,320
my queries will be
89

90
00:03:13,320 --> 00:03:14,153
insert
90

91
00:03:15,840 --> 00:03:16,673
into
91

92
00:03:19,350 --> 00:03:20,780
borrows right
92

93
00:03:22,410 --> 00:03:24,970
and here by the way need to use quotes here
93

94
00:03:27,280 --> 00:03:29,080
single quotes
94

95
00:03:29,080 --> 00:03:30,840
borrows okay
95

96
00:03:30,840 --> 00:03:32,587
and here what I need to do
96

97
00:03:32,587 --> 00:03:33,750
I need to use here
97

98
00:03:35,410 --> 00:03:36,830
parentheses and the first one will be
98

99
00:03:36,830 --> 00:03:39,010
b book id
99

100
00:03:40,280 --> 00:03:42,960
and second one will be my member id
100

101
00:03:42,960 --> 00:03:45,410
b member
101

102
00:03:45,410 --> 00:03:46,870
id
102

103
00:03:46,870 --> 00:03:47,703
borrowed
103

104
00:03:47,703 --> 00:03:49,360
borrowed book id and borrowed member id
104

105
00:03:49,360 --> 00:03:50,193
okay
105

106
00:03:50,193 --> 00:03:51,263
or borrow
106

107
00:03:51,263 --> 00:03:53,800
something like that, b means
107

108
00:03:53,800 --> 00:03:55,860
okay and after what I need to do here
108

109
00:03:55,860 --> 00:03:58,900
I need to say values
109

110
00:03:58,900 --> 00:03:59,820
for values
110

111
00:03:59,820 --> 00:04:04,705
I need to use here, two, question marks right
111

112
00:04:04,705 --> 00:04:05,950
one and two
112

113
00:04:07,160 --> 00:04:08,870
and after what I need to do here
113

114
00:04:08,870 --> 00:04:09,703
I will say
114

115
00:04:11,331 --> 00:04:12,164
cur.
115

116
00:04:13,520 --> 00:04:14,360
execute
116

117
00:04:15,300 --> 00:04:17,480
and my query right
117

118
00:04:17,480 --> 00:04:20,150
and second will be my variable names
118

119
00:04:20,150 --> 00:04:21,830
the first one is book name
119

120
00:04:22,850 --> 00:04:24,860
and second one is my member name
120

121
00:04:26,010 --> 00:04:26,900
okay
121

122
00:04:26,900 --> 00:04:27,770
and
122

123
00:04:27,770 --> 00:04:29,320
what I need to do, I need to use here
123

124
00:04:30,840 --> 00:04:32,370
con.commit
124

125
00:04:34,480 --> 00:04:35,313
okay
125

126
00:04:35,313 --> 00:04:38,916
and here if everything fine, what I need to use
126

127
00:04:38,916 --> 00:04:40,320
I need to use a message box here
127

128
00:04:41,407 --> 00:04:42,930
message box
128

129
00:04:42,930 --> 00:04:43,940
message box is
129

130
00:04:44,870 --> 00:04:45,810
something like that
130

131
00:04:45,810 --> 00:04:46,800
let me
131

132
00:04:46,800 --> 00:04:48,220
go back to top and here
132

133
00:04:49,640 --> 00:04:50,640
we need to use here
133

134
00:04:54,300 --> 00:04:56,630
import from ttk
134

135
00:04:56,630 --> 00:04:57,950
from tkinter right
135

136
00:04:57,950 --> 00:04:59,160
from tkinter
136

137
00:05:00,360 --> 00:05:02,150
import message box right
137

138
00:05:03,450 --> 00:05:06,240
its fine, now I can create my message box
138

139
00:05:08,674 --> 00:05:09,951
and
139

140
00:05:09,951 --> 00:05:10,784
here
140

141
00:05:12,099 --> 00:05:15,099
I will say message box.showinfo okay
141

142
00:05:16,925 --> 00:05:18,397
and I will say here success
142

143
00:05:20,420 --> 00:05:22,230
and here I will say
143

144
00:05:24,350 --> 00:05:25,533
success-
144

145
00:05:26,820 --> 00:05:27,653
<v ->fully</v>
145

146
00:05:28,610 --> 00:05:31,050
added to database
146

147
00:05:31,050 --> 00:05:32,870
our message something like that
147

148
00:05:32,870 --> 00:05:35,600
and we can use icon
148

149
00:05:35,600 --> 00:05:37,500
icon will be
149

150
00:05:37,500 --> 00:05:38,640
info
150

151
00:05:39,812 --> 00:05:40,645
info icon
151

152
00:05:40,645 --> 00:05:41,940
and after I need to do here
152

153
00:05:43,690 --> 00:05:45,140
here what we need to do
153

154
00:05:45,140 --> 00:05:46,310
we need to
154

155
00:05:46,310 --> 00:05:49,070
here also update our books
155

156
00:05:49,070 --> 00:05:50,910
why its like that, let me
156

157
00:05:50,910 --> 00:05:51,743
run
157

158
00:05:51,743 --> 00:05:53,112
sorry
158

159
00:05:53,112 --> 00:05:54,162
show my database here
159

160
00:05:55,995 --> 00:05:57,895
now our library database is here right
160

161
00:05:59,470 --> 00:06:01,560
and our books remember
161

162
00:06:01,560 --> 00:06:02,800
we have also field here
162

163
00:06:02,800 --> 00:06:04,710
its names book status
163

164
00:06:04,710 --> 00:06:07,180
this one by default it is zero
164

165
00:06:07,180 --> 00:06:11,070
so if I borrow, if I lend this book to someone
165

166
00:06:11,070 --> 00:06:15,390
that means, I also need to update this value okay
166

167
00:06:15,390 --> 00:06:18,010
and, because it is zero
167

168
00:06:18,010 --> 00:06:19,470
and here what I need to do
168

169
00:06:19,470 --> 00:06:21,490
we already insert into this table right
169

170
00:06:21,490 --> 00:06:24,990
but also need to insert, update our book status
170

171
00:06:24,990 --> 00:06:25,910
and here
171

172
00:06:27,070 --> 00:06:28,030
what I need to do
172

173
00:06:28,030 --> 00:06:29,350
I need to say here
173

174
00:06:29,350 --> 00:06:30,507
cur.execute
174

175
00:06:31,810 --> 00:06:32,643
okay
175

176
00:06:32,643 --> 00:06:34,720
and this time I will use
176

177
00:06:34,720 --> 00:06:35,553
update
177

178
00:06:37,390 --> 00:06:38,223
update
178

179
00:06:41,010 --> 00:06:41,843
books
179

180
00:06:42,910 --> 00:06:43,743
set
180

181
00:06:47,611 --> 00:06:49,070
books status
181

182
00:06:49,070 --> 00:06:50,170
status
182

183
00:06:51,510 --> 00:06:52,980
equals question mark
183

184
00:06:52,980 --> 00:06:55,097
okay and here I will say, where
184

185
00:06:57,640 --> 00:06:58,700
book id
185

186
00:06:59,660 --> 00:07:01,500
equals question mark okay
186

187
00:07:03,460 --> 00:07:06,017
and after that here what I will say
187

188
00:07:06,017 --> 00:07:07,130
I will say
188

189
00:07:09,410 --> 00:07:10,340
one okay
189

190
00:07:10,340 --> 00:07:11,550
because
190

191
00:07:11,550 --> 00:07:15,350
I will set it as one because it is already zero
191

192
00:07:15,350 --> 00:07:16,183
right
192

193
00:07:16,183 --> 00:07:20,500
and after that I need to also  use self.
193

194
00:07:20,500 --> 00:07:21,333
book
194

195
00:07:22,700 --> 00:07:23,980
id
195

196
00:07:23,980 --> 00:07:24,813
okay
196

197
00:07:25,902 --> 00:07:26,870
and after what I need to do here
197

198
00:07:26,870 --> 00:07:28,380
something wrong let me check
198

199
00:07:29,460 --> 00:07:30,293
its fine
199

200
00:07:31,507 --> 00:07:32,590
and again I need to use here
200

201
00:07:32,590 --> 00:07:34,860
con.commit okay
201

202
00:07:34,860 --> 00:07:37,130
I will use con.commit again
202

203
00:07:37,130 --> 00:07:37,963
and
203

204
00:07:39,470 --> 00:07:40,600
its fine
204

205
00:07:40,600 --> 00:07:42,950
but this is for, if
205

206
00:07:42,950 --> 00:07:44,430
also we need to create
206

207
00:07:44,430 --> 00:07:45,720
this is for if
207

208
00:07:45,720 --> 00:07:47,090
lets create for else
208

209
00:07:47,090 --> 00:07:49,000
our else statement
209

210
00:07:49,000 --> 00:07:50,670
else here
210

211
00:07:50,670 --> 00:07:52,290
and I will say messagebox.
211

212
00:07:53,187 --> 00:07:54,910
showerror okay
212

213
00:07:54,910 --> 00:07:56,540
and the first parameter
213

214
00:07:56,540 --> 00:07:58,260
first will be error
214

215
00:07:58,260 --> 00:07:59,560
this is our title
215

216
00:07:59,560 --> 00:08:01,680
second one will be field
216

217
00:08:04,170 --> 00:08:05,090
fields
217

218
00:08:06,592 --> 00:08:07,800
can't be empty
218

219
00:08:08,760 --> 00:08:09,593
okay
219

220
00:08:10,533 --> 00:08:11,633
and also lets use icon
220

221
00:08:12,520 --> 00:08:14,780
warning icon okay
221

222
00:08:14,780 --> 00:08:15,890
and
222

223
00:08:15,890 --> 00:08:18,024
something wrong here
223

224
00:08:18,024 --> 00:08:18,857
icon equals okay
224

225
00:08:20,101 --> 00:08:20,934
its fine now
225

226
00:08:20,934 --> 00:08:22,600
also I want to
226

227
00:08:22,600 --> 00:08:23,789
use
227

228
00:08:23,789 --> 00:08:24,840
a messagebox for
228

229
00:08:24,840 --> 00:08:26,110
except statement
229

230
00:08:26,110 --> 00:08:28,140
here I will use
230

231
00:08:28,140 --> 00:08:29,510
except this is not
231

232
00:08:29,510 --> 00:08:30,700
fields
232

233
00:08:30,700 --> 00:08:31,630
empty
233

234
00:08:31,630 --> 00:08:33,510
this time it will be something wrong
234

235
00:08:33,510 --> 00:08:34,752
so
235

236
00:08:34,752 --> 00:08:35,602
I will show can't
236

237
00:08:37,187 --> 00:08:38,020
add to
237

238
00:08:38,020 --> 00:08:40,060
database
238

239
00:08:40,060 --> 00:08:41,010
that's all
239

240
00:08:41,010 --> 00:08:42,380
if I run my application now
240

241
00:08:45,720 --> 00:08:47,890
if everything is fine
241

242
00:08:47,890 --> 00:08:49,270
crime and punishment
242

243
00:08:49,270 --> 00:08:50,850
look
243

244
00:08:50,850 --> 00:08:52,380
now this book is available state okay
244

245
00:08:52,380 --> 00:08:54,020
I will click it
245

246
00:08:54,020 --> 00:08:56,030
and my book is here
246

247
00:08:56,030 --> 00:08:57,830
I will land to Dave okay
247

248
00:08:57,830 --> 00:08:58,929
and I will say
248

249
00:08:58,929 --> 00:09:01,610
lendbook successfully added to database
249

250
00:09:01,610 --> 00:09:02,450
now lets check
250

251
00:09:02,450 --> 00:09:03,800
now this is available
251

252
00:09:03,800 --> 00:09:05,580
Da vinci code, crime and punishment
252

253
00:09:05,580 --> 00:09:06,730
as you see now it says
253

254
00:09:06,730 --> 00:09:08,100
not available
254

255
00:09:08,100 --> 00:09:08,933
okay
255

256
00:09:08,933 --> 00:09:10,340
this is also very important
256

257
00:09:10,340 --> 00:09:12,790
you also updated our list
257

258
00:09:12,790 --> 00:09:13,920
and what is next now
258

259
00:09:13,920 --> 00:09:14,860
what we need to do
259

260
00:09:15,738 --> 00:09:16,860
we need to create a new function
260

261
00:09:16,860 --> 00:09:18,290
actually the now the new function
261

262
00:09:18,290 --> 00:09:19,123
we are going to get a
262

263
00:09:19,123 --> 00:09:21,328
new python file for give book button
263

264
00:09:21,328 --> 00:09:23,310
to do that what I need to do
264

265
00:09:24,158 --> 00:09:26,510
I will go back to my main .python
265

266
00:09:26,510 --> 00:09:28,230
and here lets say
266

267
00:09:28,230 --> 00:09:29,750
give
267

268
00:09:29,750 --> 00:09:31,900
book is here so
268

269
00:09:31,900 --> 00:09:33,900
what I will do, I will create here
269

270
00:09:33,900 --> 00:09:35,170
command property
270

271
00:09:36,240 --> 00:09:37,113
and I'm say self.
271

272
00:09:38,514 --> 00:09:39,730
givebook okay
272

273
00:09:39,730 --> 00:09:41,510
this is my definition name
273

274
00:09:41,510 --> 00:09:43,111
and what I need to do now
274

275
00:09:43,111 --> 00:09:44,290
I need to create this definition right
275

276
00:09:44,290 --> 00:09:47,000
and here I will come and say
276

277
00:09:47,000 --> 00:09:47,833
def
277

278
00:09:47,833 --> 00:09:50,010
givebook okay
278

279
00:09:50,010 --> 00:09:52,339
and, sorry
279

280
00:09:52,339 --> 00:09:53,550
this capital
280

281
00:09:53,550 --> 00:09:55,020
so
281

282
00:09:55,020 --> 00:09:55,853
def
282

283
00:09:57,131 --> 00:09:57,964
giveBook
283

284
00:09:58,923 --> 00:10:01,210
and here for now I will say pass okay
284

285
00:10:02,200 --> 00:10:04,320
so what I need to do now
285

286
00:10:04,320 --> 00:10:07,430
I need to create that python file, okay
286

287
00:10:08,300 --> 00:10:09,133
givebook
287

288
00:10:10,730 --> 00:10:12,050
this is okay
288

289
00:10:12,050 --> 00:10:12,883
and
289

290
00:10:12,883 --> 00:10:14,655
after that what I need to do
290

291
00:10:14,655 --> 00:10:16,810
I need to go back to, top
291

292
00:10:17,959 --> 00:10:19,509
and here I  to import givebook
292

293
00:10:21,010 --> 00:10:22,000
okay
293

294
00:10:22,000 --> 00:10:23,570
and here what I need to do
294

295
00:10:23,570 --> 00:10:26,540
lets copy this guys, okay
295

296
00:10:26,540 --> 00:10:28,840
for givebook.py
296

297
00:10:28,840 --> 00:10:30,360
paste it here
297

298
00:10:30,360 --> 00:10:31,440
remove this one
298

299
00:10:31,440 --> 00:10:33,710
we need, messagebox is fine, we need it
299

300
00:10:33,710 --> 00:10:35,530
and after here what I need to do
300

301
00:10:35,530 --> 00:10:38,670
I will create a new class for this file
301

302
00:10:38,670 --> 00:10:39,990
so how can I do that
302

303
00:10:39,990 --> 00:10:41,560
I will go back to my
303

304
00:10:41,560 --> 00:10:43,523
givebook class
304

305
00:10:43,523 --> 00:10:45,156
okay its here
305

306
00:10:45,156 --> 00:10:46,939
it will be very very similar
306

307
00:10:46,939 --> 00:10:49,810
so I will copy all of it okay
307

308
00:10:49,810 --> 00:10:51,050
and paste it here
308

309
00:10:53,281 --> 00:10:54,740
so what I don't need here
309

310
00:10:54,740 --> 00:10:56,800
only I don't need here
310

311
00:10:56,800 --> 00:10:58,660
my global given id
311

312
00:10:58,660 --> 00:11:00,580
okay I will remove this one
312

313
00:11:00,580 --> 00:11:02,320
because my
313

314
00:11:02,320 --> 00:11:04,680
button functionality is different okay
314

315
00:11:04,680 --> 00:11:07,190
that's why I don't need given id
315

316
00:11:07,190 --> 00:11:08,550
global variable
316

317
00:11:08,550 --> 00:11:09,383
here
317

318
00:11:09,383 --> 00:11:11,240
what is next, what I need to do
318

319
00:11:12,220 --> 00:11:15,100
I need to come here, find my
319

320
00:11:16,140 --> 00:11:16,973
function, right
320

321
00:11:16,973 --> 00:11:18,000
its here
321

322
00:11:18,000 --> 00:11:20,170
I will create a new instance and I will say
322

323
00:11:21,201 --> 00:11:22,150
give book
323

324
00:11:22,150 --> 00:11:24,090
this is my instance name
324

325
00:11:24,090 --> 00:11:26,500
and my instance equals
325

326
00:11:26,500 --> 00:11:27,836
give.
326

327
00:11:27,836 --> 00:11:30,315
givebook.
327

328
00:11:30,315 --> 00:11:31,692
Python file
328

329
00:11:31,692 --> 00:11:33,680
givebook class name okay
329

330
00:11:33,680 --> 00:11:35,290
and now is fine
330

331
00:11:35,290 --> 00:11:36,710
if I run my application
331

332
00:11:38,064 --> 00:11:39,064
I will see my window
332

333
00:11:39,941 --> 00:11:40,774
this run it give book
333

334
00:11:40,774 --> 00:11:43,210
as we see now our window is here
334

335
00:11:43,210 --> 00:11:44,700
so what we need to solve here
335

336
00:11:44,700 --> 00:11:47,450
we need to, say here for the title
336

337
00:11:47,450 --> 00:11:48,283
give book
337

338
00:11:48,283 --> 00:11:51,540
and also there are some problems about
338

339
00:11:51,540 --> 00:11:52,523
combo boxes.
339

340
00:11:53,406 --> 00:11:57,630
So lets go back to here and find our text
340

341
00:11:57,630 --> 00:11:58,463
here
341

342
00:11:59,470 --> 00:12:00,760
say lend
342

343
00:12:00,760 --> 00:12:01,630
lend a book
343

344
00:12:02,900 --> 00:12:03,733
okay
344

345
00:12:04,650 --> 00:12:06,350
and here
345

346
00:12:06,350 --> 00:12:09,660
I will remove this one because I don't need it
346

347
00:12:09,660 --> 00:12:10,493
okay
347

348
00:12:11,423 --> 00:12:12,889
and what is next
348

349
00:12:12,889 --> 00:12:14,289
its fine actually everything
349

350
00:12:15,385 --> 00:12:16,401
and now
350

351
00:12:16,401 --> 00:12:17,580
also
351

352
00:12:17,580 --> 00:12:18,980
I need to create here
352

353
00:12:18,980 --> 00:12:21,030
set a book id
353

354
00:12:21,030 --> 00:12:22,940
so how I can create this id
354

355
00:12:22,940 --> 00:12:23,773
self.
355

356
00:12:25,474 --> 00:12:28,790
book id is going to be my book name
356

357
00:12:30,160 --> 00:12:32,420
dot split
357

358
00:12:32,420 --> 00:12:33,610
split by dash
358

359
00:12:36,240 --> 00:12:38,370
and here I need to use
359

360
00:12:39,215 --> 00:12:41,020
first index right
360

361
00:12:41,020 --> 00:12:42,050
because this is the
361

362
00:12:42,050 --> 00:12:43,340
the name is like here
362

363
00:12:43,340 --> 00:12:46,130
book name is like one dash
363

364
00:12:46,130 --> 00:12:47,440
crime and punishment something
364

365
00:12:47,440 --> 00:12:49,940
so the id is at first index okay
365

366
00:12:49,940 --> 00:12:51,410
if I split it
366

367
00:12:51,410 --> 00:12:52,910
and now its also fine
367

368
00:12:52,910 --> 00:12:54,350
if I run my application
368

369
00:12:55,200 --> 00:12:56,800
I can see that
369

370
00:12:58,240 --> 00:12:59,073
and now
370

371
00:12:59,073 --> 00:13:00,700
give book
371

372
00:13:00,700 --> 00:13:01,533
you see
372

373
00:13:01,533 --> 00:13:02,366
books here
373

374
00:13:02,366 --> 00:13:03,300
and all the books are here
374

375
00:13:03,300 --> 00:13:05,300
members are also here
375

376
00:13:05,300 --> 00:13:06,930
but there is a small problem here
376

377
00:13:06,930 --> 00:13:08,070
now check it
377

378
00:13:08,070 --> 00:13:12,310
here crime and punishment was not available right
378

379
00:13:12,310 --> 00:13:13,370
lets check it here
379

380
00:13:15,680 --> 00:13:17,370
crime and punishment not available
380

381
00:13:17,370 --> 00:13:19,630
I list all the books here okay
381

382
00:13:19,630 --> 00:13:20,882
so what I need to do
382

383
00:13:20,882 --> 00:13:23,260
I need to list only available books okay
383

384
00:13:23,260 --> 00:13:24,190
this is very important
384

385
00:13:24,190 --> 00:13:25,530
so how can I show this problem
385

386
00:13:25,530 --> 00:13:26,680
to do that
386

387
00:13:26,680 --> 00:13:30,420
I will go back to givebook.python
387

388
00:13:30,420 --> 00:13:31,610
and here
388

389
00:13:32,816 --> 00:13:33,649
I will say for the query
389

390
00:13:33,649 --> 00:13:34,560
select
390

391
00:13:34,560 --> 00:13:35,560
star
391

392
00:13:35,560 --> 00:13:36,660
from books
392

393
00:13:36,660 --> 00:13:39,220
but here I will use where statement
393

394
00:13:39,220 --> 00:13:40,520
and I will say
394

395
00:13:40,520 --> 00:13:41,353
where
395

396
00:13:42,810 --> 00:13:43,980
book status
396

397
00:13:47,017 --> 00:13:48,380
equals zero
397

398
00:13:48,380 --> 00:13:49,927
zero means
398

399
00:13:49,927 --> 00:13:51,258
the available books okay
399

400
00:13:51,258 --> 00:13:53,850
the books are in library okay
400

401
00:13:53,850 --> 00:13:55,210
now its fine
401

402
00:13:55,210 --> 00:13:57,000
if I run my application now
402

403
00:13:59,550 --> 00:14:01,320
and give book is here
403

404
00:14:01,320 --> 00:14:02,500
books
404

405
00:14:02,500 --> 00:14:04,560
you see crime and punishment is not here
405

406
00:14:04,560 --> 00:14:06,990
so the cyber storm is available right
406

407
00:14:06,990 --> 00:14:08,520
I will
407

408
00:14:08,520 --> 00:14:09,353
say
408

409
00:14:09,353 --> 00:14:10,970
lend it to Kate
409

410
00:14:10,970 --> 00:14:12,150
lend book
410

411
00:14:12,150 --> 00:14:15,590
now lets back to the here cyber storm
411

412
00:14:15,590 --> 00:14:16,940
not available do you see
412

413
00:14:16,940 --> 00:14:17,950
the origin
413

414
00:14:17,950 --> 00:14:19,340
or da vinci code is available
414

415
00:14:19,340 --> 00:14:20,880
lets go back to here
415

416
00:14:20,880 --> 00:14:22,920
da vinci code is available
416

417
00:14:22,920 --> 00:14:24,110
member Kate
417

418
00:14:24,110 --> 00:14:26,170
again lend book
418

419
00:14:26,170 --> 00:14:28,170
now if I go back to da vinci code
419

420
00:14:28,170 --> 00:14:29,510
you see not available
420

421
00:14:30,629 --> 00:14:31,950
and we finished our application
421

422
00:14:31,950 --> 00:14:34,030
and we learned many things
422

423
00:14:34,030 --> 00:14:37,160
and I hope also you like this application
423

424
00:14:37,160 --> 00:14:39,967
for now that's all, see you in the next.
