Messages without text in the messages framework

51 views
Skip to first unread message

Sebastian Lechner

unread,
Jan 21, 2019, 10:22:11 AM1/21/19
to django...@googlegroups.com

Dear Django community,

often I would like to trigger a message to the user with the message rendered dynamically in the client-side JS code. I use the message framework's tags to differentiate between the different messages in JS.

Usually, I will define the message's text on the client side as well, making it unnecessary to define the message text in the Django backend. My first idea was to set the message text parameter to "None" or the empty string when calling add_message.

Unfortunately, it seems that this will lead to the message beging discarded. Is there are another way to send a message without text (but a number of tags) with the messages framework?

Best regards
Sebastian

Mohd Asif

unread,
Jan 21, 2019, 11:23:59 AM1/21/19
to django...@googlegroups.com
Generate message with a random text and don't use it on front end instead use whatever u want

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/942a9d5c-f927-8e8f-78a6-c6202ed79e02%40seble.info.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages