Delete Database Records With Flask - Flask Fridays #12

Delete Database Records With Flask - Flask Fridays #12

Codemy.com

3 года назад

17,720 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@zoenayatziartechelizarraga9500
@zoenayatziartechelizarraga9500 - 06.10.2023 23:34

yea but, how can i request for a confirmation before delete it?

Ответить
@jayriihi
@jayriihi - 07.10.2022 23:18

Enjoying these flask courses very much. I've gotten side tracked and done some experimenting and it now doesn't look like yours! You mentioned that your code is in the comments here but I don't see it. Looking for a quick way to get back on track with your course. Thanks!

Ответить
@jisunger9418
@jisunger9418 - 27.07.2022 14:12

Generally you would want the next added data to be of a different Id from the previously deleted data. I get that.
But, I deleted my data id 7 and tried to add a new data but it writes as id 7 and creates a UNIQUE constraint error. Do you know how to fix this?

Ответить
@zacharywright6529
@zacharywright6529 - 04.07.2022 06:34

Hello,
Unfortunately I'm running into an issue you don't seem to have. Whenever I delete a record and then add something new, even if all the information is completely different, the "ID" field increments to the next number that would have been in line...so if I delete entry "5" and then make a completely new person they come up as "6" on the list.

Any solve for this?

Great videos nonetheless!!

Ответить
@speedster784
@speedster784 - 29.04.2022 17:04

what if you have 2 database model pointing to the same select function how do you differentiate between the IDs to delete the correct record

Ответить
@asdf8013
@asdf8013 - 02.12.2021 16:14

Hi, John could you make a video on how to have a login for a user and then a separate login for an admin where the admin can access pages the user cannot.

Ответить
@isaacndarwa
@isaacndarwa - 03.09.2021 23:58

When I delete records, my primary key still increases. I can delete records 11-20, then when I try to create a new record, the primary key is 21. It's like the primary key persists even after deletion. Is there any way to solve this?

Ответить
@sweatleek2255
@sweatleek2255 - 11.07.2021 15:52

IDK if it's a bug. But when you delete a user and you are still in the URL (delete/<id>). And create a new user with the delete url still their, it will bug out the form trow an 405 error "Method Not Allowed" well still adding the user to the database.
You can fix this by adding [ action="{{ url_for('add_user')}}" ] to the form in add_user.html

Ответить
@zuiderling123
@zuiderling123 - 02.05.2021 17:56

Hello John, i don't understand how the connection between mysql (local) and an uploaded flask site(server) is maintained

Ответить
@tonystark3399
@tonystark3399 - 01.05.2021 17:00

sir please make some more tutorials on kivy

Ответить
@thinkdifferent0073
@thinkdifferent0073 - 01.05.2021 06:24

Sir can you teach about pyopengl , please consider this sir

Ответить
@amankumarbairagi794
@amankumarbairagi794 - 30.04.2021 16:14

JOHN sir plese make video series on android devlopment in 5 to 10 hrs something like that

Ответить
@bishalroy360
@bishalroy360 - 30.04.2021 16:01

First view and first comment.

Ответить