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

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024

Комментарии • 53

  • @Codemycom
    @Codemycom  3 года назад

    ▶️ Watch Entire Flask Friday Playlist ✅ Subscribe To My RUclips 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

    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;-)

  • @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!

  • @witty_name9768
    @witty_name9768 7 месяцев назад

    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  7 месяцев назад

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

  • @zdravkojovancevic4656
    @zdravkojovancevic4656 2 года назад

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

  • @ardenttechie
    @ardenttechie 2 года назад

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

  • @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?

  • @figofontana4770
    @figofontana4770 4 месяца назад

    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.

  • @vijeandran
    @vijeandran 2 года назад

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

    • @Codemycom
      @Codemycom  2 года назад

      Make a query for what you want to search for.

  • @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?

  • @hermano511
    @hermano511 3 года назад +1

    Amo seus videos, show de bola, very good

  • @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.

  • @eritreawoldu4848
    @eritreawoldu4848 2 года назад

    Thank you, you are the best

  • @teclote
    @teclote 10 месяцев назад

    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  10 месяцев назад +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

  • @anshgoyal5547
    @anshgoyal5547 Год назад

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

  • @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!

  • @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

  • @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?

  • @mugomuiruri2313
    @mugomuiruri2313 15 дней назад

    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

  • @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.

  • @elliejohnson2786
    @elliejohnson2786 2 года назад +1

    Definitely way too zoomed it, but extremely helpful nonetheless.

  • @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!

  • @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

    • @Codemycom
      @Codemycom  Год назад

      Sorry, I don't use access

  • @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.

  • @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

  • @lakshyajain0553
    @lakshyajain0553 6 месяцев назад

    where i find code

    • @Codemycom
      @Codemycom  6 месяцев назад

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

  • @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. 🤦‍♂😂