Adding a MessageMixin?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding a MessageMixin?

Ajat Prabha
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. 🙂

--
You received this message because you are subscribed to the Google Groups "Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/74c4d03f-0b25-4508-833e-04296419b0fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Adding a MessageMixin?

HĂ©lio Correia
Hi, are you referring to this https://docs.djangoproject.com/en/2.0/ref/contrib/messages/#adding-messages-in-class-based-views but with more mixins ?

Em terça-feira, 24 de abril de 2018 12:34:35 UTC+1, Ajat Prabha escreveu:
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. 🙂

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/be8fb6c7-d12a-4c7b-b9fa-8f8ec3622a83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Adding a MessageMixin?

Ajat Prabha
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)

--
You received this message because you are subscribed to the Google Groups "Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/8f76c2e7-8987-490d-8a05-4ab6bc18397d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.