Adding a MessageMixin?

57 views
Skip to first unread message

Ajat Prabha

unread,
Apr 24, 2018, 7:34:35 AM4/24/18
to Django developers (Contributions to Django itself)
Hi there,
I often find myself repeating the process to add messages to inform a user about certain things. Yes, I use mixin after a few repeats.
So I had this idea if we can add a MessageMixin in generic CBVs for easy addition of messages to a request in case of views like CreateView, UpdateView, DeleteView, etc?

I'd appreciate thoughts on this. 🙂

Hélio Correia

unread,
Apr 24, 2018, 8:10:27 AM4/24/18
to Django developers (Contributions to Django itself)

Ajat Prabha

unread,
Apr 25, 2018, 12:02:11 AM4/25/18
to Django developers (Contributions to Django itself)
Yes, I'm referring to the same.
Tim Graham also answered this in django-core-mentorship [https://groups.google.com/forum/m/#!topic/django-core-mentorship/qNtv-NqgDkc]

Currently I'm thinking over the possible use cases where this can be useful other than the need to define the mixin on our own.

If you see a problematic situation, I'd like to hear about it.
One such is talked in this https://code.djangoproject.com/ticket/21936 (providing success message for deletion)

Reply all
Reply to author
Forward
0 new messages