1
00:00:00,480 --> 00:00:01,830
All right, well, hello, dear friends.

2
00:00:02,760 --> 00:00:07,530
So in this lesson, we're going to load the leave table from the database.

3
00:00:08,610 --> 00:00:10,080
So let's get started.

4
00:00:11,190 --> 00:00:11,480
All right.

5
00:00:11,490 --> 00:00:14,220
So we need to populate employee leave info table.

6
00:00:14,280 --> 00:00:20,160
So I do want to create a method called init tables self, not in at tables.

7
00:00:23,640 --> 00:00:30,720
Well, the fine and it table def in it table itself, and for these tables, all we really need to do

8
00:00:30,720 --> 00:00:37,500
is create a database, get the results set for the leave info and coordinate table function.

9
00:00:37,650 --> 00:00:40,770
So our database is equal to database.

10
00:00:42,190 --> 00:00:49,120
Leave info equals self-taught database dot get employee leave info, self dot I.D..

11
00:00:57,660 --> 00:01:01,890
And let's create another function called Enit table, def init table.

12
00:01:02,460 --> 00:01:07,650
And what is going to be received as parameters is the table which we want to load.

13
00:01:09,240 --> 00:01:12,360
Self table widget, header list, values list.

14
00:01:15,030 --> 00:01:17,640
Now let's call it selfcare and it table.

15
00:01:21,740 --> 00:01:24,770
Self-taught yuai table widget to leave.

16
00:01:29,900 --> 00:01:32,000
Comma, info zero.

17
00:01:32,030 --> 00:01:33,320
Leave info one.

18
00:01:36,660 --> 00:01:43,680
And let's go ahead and copy and paste the code from Manege employee, because that's what I have initialized

19
00:01:43,680 --> 00:01:44,790
the table for.

20
00:01:45,330 --> 00:01:49,500
So let's see if we retrieve the row and the column count.

21
00:01:50,370 --> 00:01:56,040
We had row count and the column count through our table widget said the horizontal label selection mode

22
00:01:56,040 --> 00:02:02,610
set that the header should be stretched to the end of the table with it, and then a selection behavior

23
00:02:02,610 --> 00:02:07,980
should be allowing us to only select whole rows and hide the vertical header.

24
00:02:08,490 --> 00:02:08,820
OK.

25
00:02:10,450 --> 00:02:17,220
And then only load values for a table so we can copy and paste that here, just replace the table widget

26
00:02:17,220 --> 00:02:17,730
variable.

27
00:02:18,990 --> 00:02:21,330
Let's call these values list.

28
00:02:21,330 --> 00:02:25,020
And all we have to do is import right here.

29
00:02:28,830 --> 00:02:33,300
From Picardy five Dot Kudi widget import all.

30
00:02:38,130 --> 00:02:41,520
So now when we go to modify, the database is not defined.

31
00:02:41,910 --> 00:02:43,110
So let's see database.

32
00:02:43,770 --> 00:02:48,330
And we have to import it from database import database.

33
00:02:58,440 --> 00:02:59,220
So let's try it again.

34
00:03:08,500 --> 00:03:10,150
And there's the result.

35
00:03:12,350 --> 00:03:19,160
So you can count this type of problems when you forgot to import the database of any other Python module.

36
00:03:21,800 --> 00:03:29,930
So now we can check the leave details compared with our the baby boom, just like that.

37
00:03:29,960 --> 00:03:31,160
Yes, they are the same.

38
00:03:32,210 --> 00:03:32,620
Very cool.

39
00:03:32,630 --> 00:03:33,220
So that's it.

40
00:03:33,230 --> 00:03:35,690
We've loaded the leave table from the database.

41
00:03:37,070 --> 00:03:39,440
See in the next lesson, all right, Coke.
