How To Update A Record In The Database - Flask Fridays #10

Поділитися
Вставка
  • Опубліковано 1 січ 2025

КОМЕНТАРІ • 53

  • @Codemycom
    @Codemycom  3 роки тому

    ▶️ Watch Entire Flask Friday Playlist ✅ Subscribe To My UA-cam Channel:
    bit.ly/3ig2eJn bit.ly/2IGzvOR
    ▶️ See More At: ✅ Join My Facebook Group:
    Codemy.com bit.ly/2GFmOBz
    ▶️ Learn to Code at Codemy.com ✅ Buy a Codemy T-Shirt!
    Take $30 off with coupon code: youtube1 bit.ly/2VC9WUN
    ▶️ Get The Code
    bit.ly/2L1jBl5

  • @violoriser856
    @violoriser856 3 роки тому

    Subsribed on the first 3 minutes. When a man knows, a man knows... Excellent way of teaching!

  • @strycinek
    @strycinek 2 роки тому +2

    The connection between MYSQL and FLASK is really cool. What we forgot to do in this part of the tutorial was validate the updated email address for duplicity like we were doing in inserting a record;-)

  • @witty_name9768
    @witty_name9768 11 місяців тому

    Guys beware of typos, I left out some quotes in the methods and spent 15 min trying to figure out why I didn't have permission to use the 'Get, Post' method.

    • @Codemycom
      @Codemycom  11 місяців тому

      All coding is exact, you can't ever have typos in any code ever.

  • @realdrnobody
    @realdrnobody Рік тому

    Thank you so much for making this video! You are a lifesaver! I forgot to give the form the specific id for its action!

    • @Codemycom
      @Codemycom  Рік тому

      Glad you got it sorted out!

  • @zdravkojovancevic4656
    @zdravkojovancevic4656 2 роки тому

    These videos are so great and helpful, thanks John! 👍

  • @AswinKumar4u
    @AswinKumar4u 2 роки тому

    Hello John,
    Thanks for the the tutorials on flask Fridays.
    I was wondering how one would load the data from the db to the update.html for elements like radio buttons or check boxes or dropdowns?

  • @MeMyselfAndBob
    @MeMyselfAndBob 2 роки тому +1

    the try/except db.session.commit() doesn't work when changing one of the user credentials to an existing value in the database (eg when updating the user and changing the email address to the email address of an existing user, there is still an error pop-up (because of our 'unique' statement) instead of the 'except' kicking in with a flash message "Update not successful!". How come?

  • @teclote
    @teclote Рік тому

    Error at 8:35 I believe. On line 21 of update.html it references "our_users" but this object is not passed from app.py. (lines 45 through 66). I'm stuck here. Do you fix it later in the video? I understand you copied it over from the add-user page. Thank you. Great video.

    • @Codemycom
      @Codemycom  Рік тому +1

      Seems to work fine in the video...right? Are you asking if I fix it later in the video without bothering to watch it yourself? This video is 2 years old, I have no idea...watch it and see lol

  • @vijeandran
    @vijeandran 3 роки тому

    HI, Instead of printing all the columns in GET request, How could I get only specific columns from the Postgres table?

    • @Codemycom
      @Codemycom  3 роки тому

      Make a query for what you want to search for.

  • @figofontana4770
    @figofontana4770 8 місяців тому

    Hi Im studying python and is fairly new to this field and I have a question for 11:05 Ityped
    Update Data
    depending on my code, id is road_id but i get an error saying
    werkzeug.routing.exceptions.BuildError: Could not build url for endpoint 'roadupdate' with values ['road_id']. Did you mean 'updateRoad' instead?.
    I don't know how to solve this hopefully I can get some help.

  • @torenderamus8105
    @torenderamus8105 2 роки тому

    Hi John. Love the videos and they are so super helpful. In this video from 11:30 - 14:50 you explain how to pull a record for updating by creating a link for the database. I could use some help with on other step that I can't seem to figure out. By the method explained here it works well with a few records. My database has assets and it will have thousands of records, so the clickable links would not be very efficient alone. How would we alter this code in order to perform a database lookup for and to display a single database record that needs to be edited? I use an asset number as the primary key and need to pull the single record for the asset by entering the devices asset number. Pleas advise. Thank you.

  • @downraverben
    @downraverben 3 роки тому

    Hey John when doing the update.html. I am using a SelectField. The value=name_to_update does not seem to work on that type of field. How can I get it to pre load the value on a SelectField?

  • @ardenttechie
    @ardenttechie 2 роки тому

    Thank you boss. This was very helpful. You are the best

  • @ianpring7186
    @ianpring7186 3 роки тому +1

    Hi John I'm confused, thought we were using mysql but I see app.config points to sqlite3 as it does going back to video #10 !

    • @Codemycom
      @Codemycom  3 роки тому

      Use either one...as I explained at the end of video 9, you can use either one just by changing the one line of code. The app stays the same regardless of which one you use. It doesnt matter.

  • @bensaidlucas6563
    @bensaidlucas6563 3 роки тому

    Hey, John thank you for your video !!
    Just a question: "Why do you specify the update path in action in the form?"
    It seems to work without and render_template should not guaranty the connection of the form with the update view?

    • @Codemycom
      @Codemycom  3 роки тому

      you can do it either way

  • @aniketnegs
    @aniketnegs 2 роки тому

    Hey John. I totally love this course and it is helping me a lot in my school project. Thanks for that. I'm having trouble trying to pre-populate the form. I have a dropdown menu(made using the select field in flask-wtf) and a date input. How can i pre-populate(pre-select in case of the dropdown) these fields?
    Thanks in advance for your help!

  • @anshgoyal5547
    @anshgoyal5547 Рік тому

    It is throwing error when same email is passed in updated record

  • @catsandmusic4635
    @catsandmusic4635 3 роки тому

    Hey John, us there a way to move a tkinter application to flask? Just wondering, as there's a tkinter project I've made which I need to turn into a web-based application.
    Thanks in advance!

  • @hermano511
    @hermano511 3 роки тому +1

    Amo seus videos, show de bola, very good

  • @yilinye1058
    @yilinye1058 3 роки тому

    Hi, I really like your videos. But when i try your method to update all the information include the ID which is primary key, it just failed. The error says can not update a none value. Does that possible to update a primary key?

    • @Codemycom
      @Codemycom  3 роки тому

      You can't update a primary key

  • @merish22
    @merish22 Рік тому

    hi dear have learnt alot with you kindly show me how i can create one form for my three datatables in ms acess that captures anew record ,save and search in all the three tables. at once .....thanks .. Mary Airlines

  • @eritreawoldu4848
    @eritreawoldu4848 2 роки тому

    Thank you, you are the best

  • @alternativepotato
    @alternativepotato 3 роки тому

    John love ur videos, wondered if u could help with something i used flask mail to send a few reset tokens but unfurtunately the whole process doesnt work when the server is deployed sincerely no clue why(unironically it works perfectly on local), i was just wondering if you could give me some good alternatives

    • @Codemycom
      @Codemycom  3 роки тому +1

      When doing production, you’re going to want to switch to a third party email service integration like mailgun or something like that...

    • @alternativepotato
      @alternativepotato 3 роки тому

      @@Codemycom Wow thanks for the quick answer, well i just found out the reason why. But thanks for the tip. It was a problem related to linode, who defaultly block certain ports which turns out to be the ports that i was using.

  • @lakshyajain0553
    @lakshyajain0553 10 місяців тому

    where i find code

    • @Codemycom
      @Codemycom  10 місяців тому

      In the pinned comment, just like I said in the video

  • @elliejohnson2786
    @elliejohnson2786 2 роки тому +1

    Definitely way too zoomed it, but extremely helpful nonetheless.

  • @pmark9410
    @pmark9410 2 роки тому

    Hi Codemy, I love your tutorials, it's helping me a lot. I have a little challenge, my update button is not clickable.
    Help me out please

    • @Codemycom
      @Codemycom  2 роки тому

      There's a problem with your html button code

  • @mugomuiruri2313
    @mugomuiruri2313 4 місяці тому

    good

  • @shantanu6940
    @shantanu6940 2 роки тому

    Bluddddy full full confused

  • @dakoderii4221
    @dakoderii4221 Рік тому

    ChatGPT won't take developer jobs anytime soon. It couldn't tell I forgot the @ for the route decorator on the update route"@app.route('update/', methods=['POST', 'GET']". It said it should be working. The url_for() in the update.html kept throwing errors and I was stumped for about 45 minutes. 🤦‍♂😂