Django Tutorial for Beginners – 32 – UpdateView and DeleteView

[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –


Posted

in

by

Tags:

Comments

42 responses to “Django Tutorial for Beginners – 32 – UpdateView and DeleteView”

  1. RASHMIT PANKHANIA Avatar

    if someone is getting DeleteView is missing a QuerySet. Define DeleteView.model, DeleteView.queryset, or override DeleteView.get_queryset() then please chaeck your model.py and views.py name should be matched

  2. Bkzhotsauc3 Avatar

    I know alot of you guys who mentioned about Bucky's sudden changes to the index.html are probably not following this anymore but for anyone else who just saw this tutorial like me here is what you have to do:

    He added a couple of things to his home page i.e. his index.html which is all Bootstrap stuff. I don't know Bootstrap or front end web dev stuff yet so my aim is just to get the functionality of this youtube video working. The clue to get the delete button working is when he does <form action="{% url 'music:album-delete' album.id %}" method="post" style="display: inline;"> . Where is album.id coming from? It's coming from the for loop he did for the <ul> </ul> to create the lists of album titles waay back in the previous tutorials. Therefore you need to ensure that your form code is contained WITHIN the for loop . So basically copy and paste his <form> </form> code and place it before the {% endfor %} statement. You can even look at 4:50 and see the {% endfor %} all the way at the bottom of his index.html

    Your home page definitely won't look like his because of all the Bootstrap code you gotta do but you will get the functionality that this video is teaching i.e. the delete button showing and working. As for the update functionality I had no problems at all with that so I'm not sure where people are having problems. Hope this helps someone else!

  3. deepak kumar Avatar

    After 29 video all are not understandable due to the cut copy past

  4. SHAKUL SHARMA Avatar

    i want the new index.html and detail.html code that bucky added in middle..please help me

  5. darthrinvador Avatar

    Buck or someone, which html file are we adding the udpateview button?

  6. Galo Javier Coloma Villón Avatar

    Bucky I'm very grateful for your tutorials, I'm starting in Django world I hope to make some many questions just to clarify some points

  7. Shaquille Antoine Avatar

    Bucky I must say, and I hate to comment on youtube vids, you save my grades this semester ^_^ lol
    Keep doing you bruh and most specifically, the humour bits (y)

  8. Arsalan Anwari Avatar

    for people getting template errors. Bucky forgot to mention that 'reverse_lazy' only works with POST or GET methods. so… use a form and not <a href>

  9. Arvind Ramadurai Avatar

    Why has he used a form in delete button? Can't we simply use button and <a href> ???

  10. Karol Borecki Avatar

    why he didn't use generic views in project on github?

  11. V C Avatar

    I am trying to add a create view for the songs using the same method as creating the albums but I keep getting an error when I submit the song form. It says NOT NULL constraint failed: VApp_topicdetail.topiclist_id. Anyone find a way to do this; nested createdviews with foreign key

  12. Lars Ericson Avatar

    The code in the GitHub for Viberr doesn't use AlbumDelete, AlbumUpdate etc. and uses different naming conventions for URLs. It was published around same time. Bucky whats up?

  13. greddee Avatar

    If anyone runs into the same problem as me with having the UpdateView returning blank fields, you need to be certain that the form doesn't have method="post". If you are using a form that is.

  14. Bernie Pruss Avatar

    I was with you till here. Not happy about the code changes in the middle of tutorial. I'm going to try TeamTreehouse now instead of continuing.

  15. Vincent Lao Avatar

    Hey guys, any idea how can I customise/ change the way the input boxes and title look ?
    I tried using the usual css but it doesn't work for me

  16. Vinayak Joshi Avatar

    can someone please give me detail.html coding please

  17. Al Adolfsen Avatar

    This is a typical problem I have had with every New Boston tutorial.  When they are not going back and fixing errors in the video that could have been avoided with planning, they insert code without telling.  I don't know bootstrap, and I'm looking at this not as a user to create a home system, but to use in real life job situations.  I would recommend Udemy, as although they have their issue too, they show all steps, and the tutorial is monitored to respond to questions.  And I resent being called MoFo.

  18. Виталий Заярний Avatar

    Sorry, what i can do, if i have problem :"NoReverseMatch: Reverse for 'delete_album' with arguments '('',)' and keyword arguments '{}' not found. 1 pattern(s) tried: [u'music/album/(?P<pk>[0-9]+)/delete/$']"

  19. Nemix Bg Avatar

    What about SongCreate view? You should explain how to make forms that have FOREIGN filed…how to automatic chose the album when want to add new song and how we can show that album_title in panel-heading in song_template?

  20. Hande T. Avatar

    Hey Bucky, you fucked up when you said "you know bootsrap anyway bla bla". I dont know fucking that stuff. So please dont make this awasome tutorials shit!

  21. Bahier Barekzoy Avatar

    When you redirect to the details view when creating an album you have the redirect in models.py in the method "get_absolute_url" where you use "reverse()"

    In this video when you redirect to main page when deleting an album you have the redirect in views.py in the class "AlbumDelete" and using "reverse_lazy()"

    Whats the difference between these two? can't the "create album" redirect be in views.py also?

    Also, Your source github for this tutorial doesn't use class based views anymore like it does here, also I don't see the "get_absolute_url" in models.py anymore… maybe you will remove this in later videos.

    BTW . I am loving these vids! Keeps me engaged, I am going to look at some of your other tutorials.

  22. Nelson Diaz Avatar

    Where is the source code of this tutorial? I didn't find it in github

  23. Kamil Latosinski Avatar

    Django is kinda strange

  24. Ishan Subedi Avatar

    So how does adding songs work , anyone tried it?

  25. magnus bidson Avatar

    Awesome tutorials! Thank you. One question though. How come it's enough for the 'music:details' to be referred to by a single button, but when referring to 'music:album-delete', you made a whole separate form for it?

  26. J Helton Avatar

    Very awesome tutorial. Did you include in any of these on how to get the search bar to function? That has been the bane of my existence forever, and nothing has helped much. Ive spent a crap load of hours on it.

  27. Vaios Avatar

    So, i mess things up too. My code does not work anymore, so i replace my project with that in github and i just review the code till the end of Tutorial.

  28. 0komi Avatar

    Well my page looks like dogshit but its working.

    One question: are this like the free tutorials? I mean do you have other tutorials on Django behind a paywall?

    Thank you for this amassing tutorials.

  29. Ishwar Kumar Avatar

    please anyone help code in index.html… i am not able to find the code of it

  30. Rajiv Jha Avatar

    Hey Bucky, I got an reverse mismatch error while deleting. kindly help

  31. Varsha Varadarajan Avatar

    I have followed all the steps exactly, stll not able to create , update, or delete. Please help

  32. Doug Beney Avatar

    What's the point of having the line "<input type="hidden" name="album_id" value='{{album.id}}'>" in the delete form of the template? I took it out and the code still works fine.

  33. jarmadax Avatar

    Bucky: I really appreciate your tutorials, but please do not add/edit code between the videos. It makes following a struggle. Maybe just say "were just going to tidy things up in this video to prepare fot he next video so feel free to skip this if you already know Boostrap" etc

  34. topo19990038 Avatar

    finally a usefull playlist tutorial! thx! (above all out there)

  35. Galaxy splus Avatar

    I couldn't follow the tutorial after Details and Delete comes out of sudden from nowhere in Index.html at 4:33. Last time, you were seen editing Index.html in tutorial 29 at 9:25. Let me know If i am wrong or someone else also went through it. 🙁

  36. omkarjere Avatar

    Whenever I try to delete an album I get a template doesn't exist error.

  37. MrInexistent Avatar

    For the urls part why don't you use carrot(^) in the beginning.

  38. MK Designs Avatar

    guys please checkout my channel and also please show your support!

  39. Newb Programming Avatar

    That is the most ridiculously looking scripting language I have ever seen. Holy fucking shit.

  40. Yitchi Avatar

    can u make a tutorial on AJAX? I am trying to send a POST to Django using JS but it gives me a csrf problem

  41. Yitchi Avatar

    man u r seriously the best! I was waiting for you to do a tutorial on Django

Leave a Reply

Your email address will not be published. Required fields are marked *