All right, so welcome back. So in the previous session, we saw how to add some such feature to our CI, and how to show the data in Osceola. Now let's see how to edit our data, right how to add editing of our jobs inside our database. So let's enter our CL so let's see how to a credit. I'm just going to go to the top of my phone and write some functions to help us with that. So I'm going to just create a simple function is going to be an edit function define our function with edit job by a particular stuff to be greeted by me.
Right so the first thing is going to be our board name, then our new name that you're editing by. Right, perfect that's updating to the new building. Is acute within the normal SQL update to help us with that show to be updated. Did table Our job stable and what are we updating which we are updating and then we are setting the old name. Setting the title for this is named to certain the name from the automatic infamous, we're setting the name to this option. Let's make it like this option right?
If it were you so first of all in updating or editing you have to first of all search for it right? Then after searching for it, then you can actually edit it right we are editing, we are searching for it and also editing or updating that particular piece written name by that particular option that is going to go with the normal format. So it's format. So what are you passing you are going to pass in our old name in our new need to help us with that. So we are actually searching for the good name here. Right there, yeah, I've written it or setting it to the new name.
So this is going to go with our union fist. Because that's what you have sitting here, right? Now, okay? That's a basic idea, then after that you have to commit the code to its commit to actually commit data stuff, that now we can be able to get the data back again, right? To go to the data. See that fetch Oh, there, we cannot retain that data to retain it.
So that's the big idea of how to edit objects are using this particular option to edit job by name, then you are passing the code name a new name, then you are updating a table by first of all searching for that old name, here with this particular option, then after certain certain for it, we will update it to set it to a new meet to congest capitalism function for our title He's wanting to get a job by title to edit job by status. So let's go on with this offer title. Just change these ones to title right that's the basic idea the same code, but just changing the name. So just want to be title to edit your by title do the same thing for your status can add the address to it if you want to do this this and this and then finally you have this is just going to be by status, the status or status anyhow you call it right.
So that isn't the basic purpose we have need to write down three functions. So one to edit by name, want to edit by title want to edit by status, right so in case you want to do that you just run or nothing option So let's come back to our CLA command, which is the Edit job and then write some code here. So what we tried to do just for writing some code and and how we are going to be editing it that should be edited by Cloverfield, right. So it's going to be like this be edited by field. And the particular way that you want to change by policy default is going to be developer field. Right?
This applies because it is a full like that offered like title. Then another option not to be green is the old to be the old ninja gesture for which can be developer, then the new one that you get into who's going to be the data scientists. Something very basic, it's very simple. So that is what you are trying to do, right? So you have to create a function an option for the field, an option for the old option for the new. So let's click on it.
So I just come back here and then right my first one is going to be selected option for the field. So it can be Wrong format and then it should format right is going to be fulfilled and create another one for the option for our old name and our last name could be old. School can also add help so it is going to be hard to like help hold name owed data to edit right there at the same day for the next one which is going to be for new. So this is going to be filled hootenanny knew it's good to be in then new data to update right. new data to this very interesting right now is passing our build our code and then our pivots Something very cool, you can actually bring this particular code above here. So let's say for example, something easy for the user to use, as one of our best practices.
Couldn't be Python three, and I'll pass it here, right, something very interesting. Let's see this one, this come back down. And now from here, I can actually start writing some code is going to be click that circle. Then I specified a photo editing, editing field. And I pass in a class with a percentage editor, so at least you know what's for the editing with old data, right then, and updated with the new data, right, so we have a full database and editing by the third name. And then the data day for the old one, the current or the updated data center like this thing is good format.
Can I pass in festival which party might Then I pass in Dennis, good to be the old name, then a new name or a new data, right? So I got to add some foreground color to it, which is going to be white. And then the background is going to be cyan, or can be any color. Let's make it look different. We have to right center very simple. And let's see how to work with a fascist.
So we'll be using the same factories above to help us but it is more useful in case we actually show the user what is going to be edited the previous data before, edited and deleted we show they have deleted so let's make if I click Echo, in PC tendonitis, some beautification stuff to it. So this will be just simple like that right now I can mute get everything from that's it. This was result Which is going to be my view all jobs previewed every tester with integer result, then I can just use the same code we have above here for viewing our data, which will this same code here, copy the same code to actually show the user what is there before these are updated, right? Perfect, then the next question is going to be what you be trying to update. So I just move on to the next option, I can specify the field that I want it by, as well as the rest.
Perfect, so not gonna screw it no more if condition is going to be if my field is equal to title, right. Then I wanted to use that title. Let's call that result. This can be resolved one or two. Let's make it as results. Right now, just so everything is that a particular result.
If I felt it's good to title, then I want to use the Edit job by title function in order to pass in your personal data. coordinate ended and unique, right. So in any case, if I just did it, then would you print it out again to be using the same command above here, because we are trying to bring all the same stuff. Let's come back to this option. Recently this right, we are bringing the result. Perfect.
So I'll just repeat this one, let's make this one result. At least read or to write or at least it's very different from the other one. And I'll just come back let's make this table to table two notes to be table one. So going to it I just copy this one and repeat for the rest. So, for the next one, for this one, so this is going to be if the field is name, right the company name then I want you to use edit by job and the job binding. entity same thing.
Then if the field is status, do the same thing right The basic idea you're editing this particular option here, by the stitches to the same punches above is what you're trying to use. Let's make this an elsif. Pivot something very simple, something really busy, can also add an else condition to it. But let's leave that one. So I thought writing something like that after we have to shoot either what has been updated, so in do so I can just repeat the same stuff here. So this is going to be the new data right to you, first of all, preview the data.
It is the data, then we tell the user that this is the new data, right? So this is going to be updated, updated. The right so the same stuff we are doing. Now let's come back to this. Let's take a circle back to my terminal which is here to find this shoe or that hope doesn't With any videos on Arrow somewhere with this white background stuff, which is on line 193. So let's edit it at line one, three, which is here 123, then we have to make it as foreground background, which is going to be BG, right?
BG, once again, doesn't give us any error if it everything is working, because I want to edit data scientists to AI engineer right, so I can just do the same thing. So lucky it's going to be my edit, job. agree that says hope, beauty see how it works, right? So the same thing would be at a job apart in the field. Before that I'm editing is the field called title. So small title, then what I'm trying to edit is going to be a hood name.
Let's make it with the equal to editing data scientists. Then the new name good Be a start up and put it on putting AI engine, you know what I received in a very different, right? If I save it now, which add it to a supervisor given us editing field title with data scientists can update into AI engineer, then disappear data is what data scientists and under the updated data is AI engineer. Right? Very, very interesting. So we have seen how to actually edit our data.
Very, very cool. So now let's move on to the next option of how to delete our data. So which is going to be coming back to the same place, so I'll come back to it took my fault here, write a simple function to delete it with the diff and delete data. Right so let's see how how is going to be to be deleted by title by to passing title here. Can you see that execute, see that execute. Then what I'm going to pass there's going to be a normal SQL function is meant to be deleted.
From my table, my jobs table Particular stuff, right? So for my joke table where the title is equal to what is being supplied, tend to be this option. I'll pass it here, this good format, I see my title, then I have to commit it to that at least it's become executed to con its commit, then I can actually retain it or I can just lose it, right number 10. Anything. Let's see the final so it is going to be used to delete our data. So delete from our table, where the title is upper class data apply for come back to my delete option command here and work on it.
So let's see how to work on it. We've got to be very simple. So we are using title to delete it. So it's going to be a simple code like this. As you bring an option of title to be click that Option, not passing by title, title, long format, short format. That is something simple.
Now passing that option inside my function, then I'll just tell the user that I'm going to delete this particular topic to be click. Let's copy the slides above. At least it's good to see help us save time. Unless you just search one. Yeah, becoming easy, right? Anyway, this, this is going to be deleting then passing the test that you're trying to get is meant to be a title.
Right? Perfect. So this is a very simple now, IBM to work on a service. First of all, I think it's better you also preview to the user, what he's going to delete before the user deleted. So I'll just use the same code we did above for the previous Here, so the user knew that he is deleting something. Let's make this one, right.
So instead of it being signed, which make us read in that is dangerous. Then later on, I'm going to actually work on the function to deleted so I'll just come back to the same place and go to my result is going to be resolved to is going to be our delete, delete data. And I'll pass in my data, right, so I'm going to pass in a title. Then I'm going to click to echo and I thought data which has been deleted, so turn that deleted. Let's make it big or delete. deleted from dB.
Right from database. Something very busy, I can even make it seem tallada Have you? So let's make it like that. You bring it here. Use sickle for that. So let's see what else right again, I'll come back to this.
Let's check for the show Oh, we have our data a case I want to delete one from it. So I can just use the help to help us with that. It can delete our job. So if I want to delete a job, we just come up to delete, job, just help. So we are supplying the title. So whenever we delete the job by the title, and the title you're trying to delete by is that from our data, we had AI engineer get on to delete the engineer from it can just come back to the same place.
He continued on it fizzle. It's good to show the data, right? If it then is going to delete it. So if I come back, can I run it again around the show all option. Now here engineer today is how to add division option to Osceola. For a nutshell, we have seen how to build a simple job tracking ci that is using adios crude option create, read update delete, to help us track and keep records of all our job.
So we have seen how to click on the database while using SQL lite database have created individual functions to help us directly database to edit to delete, then you created our simple COI commands. And then we used orders you have learned previously to be able to put up something very basic something very simple. So thank you for watching this in the next session of how to add some beautification to Osceola. Thank you and stay blessed.