talkpython / 100daysofweb-with-python-course

Demo code and resources for our 100 Days of Web in Python Course
https://training.talkpython.fm/courses/explore_100days_web/100-days-of-web-in-python
630 stars 390 forks source link

Days 045-048 Build a simple Django app [v20/22] missing messages #91

Closed chriskessler closed 2 years ago

chriskessler commented 2 years ago

Hi There, I noticed once switching to class-based views from function-based, we lost the messages for successful new|update|delete in the video and it wasn't addressed. Any chance that could be touched on? Or maybe I missed something?

Thanks! Chris

bbelderbos commented 2 years ago

Good catch, I did not realize that, thanks!

It's hard to update the videos right now, but you can try to use the SuccessMessageMixin using this example: https://dev.to/serhatteker/show-message-in-class-based-views-django-4a4d

I abandoned cbvs since ;) - I find function based views way more straightforward. See this reference: https://spookylukey.github.io/django-views-the-right-way/

HTH Bob

chriskessler commented 2 years ago

Great! Thanks for the links and for the quick response