Re: Django 1.4 - how to display a success message on form save

2015-08-04 Thread Sammy
I'm pretty sure you have to use AJAX to display the message without reloading. -- 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+unsubscr...@googlegro

Re: Django 1.4 - how to display a success message on form save

2015-08-03 Thread Iyengar8
But the message gets displayed only after I reload the page, the page isn't updated. On Tuesday, 26 June 2012 08:46:04 UTC-4, JirkaV wrote: > > >> @Jirka - thanks. I saw something about the messaging framework and even > >> tried one example which did not work. > > Using the messaging framework

Re: Django 1.4 - how to display a success message on form save

2013-04-04 Thread Zach Mance
Hi Kurtis, I saw your SO post, and I'm trying trigger success messages from my CBV's, and I'm just wondering how your "MessageMixin" methods work with your CBV's. For example, where/how does the form_valid() get called to pass the success_message from the CBV's. Also, will this work with 1.4?

Re: Django 1.4 - how to display a success message on form save

2012-06-26 Thread Kurtis Mullins
We do it all over our site. I use class-based views but you can checkout my "MessageMixin". I have the code on this stackoverflow page: http://stackoverflow.com/questions/5531258/example-of-django-class-based-deleteview/10903943#10903943 It will show up wherever you send the user to next, as long

Re: Django 1.4 - how to display a success message on form save

2012-06-26 Thread maumercado
Go with @JirkaV suggestion, also, you can add some jquery effect so that the div appears then fades out on success or on error... its pretty simple and really great! On Tuesday, June 26, 2012 4:48:31 AM UTC-5, Lloyd Dube wrote: > > Hi everyone, > > I have a form on which I'm calling save() and i

Re: Django 1.4 - how to display a success message on form save

2012-06-26 Thread Jirka Vejrazka
>> @Jirka - thanks. I saw something about the messaging framework and even >> tried one example which did not work. Using the messaging framework is actually very simple. You need to enable the messaging framework (see the steps here: https://docs.djangoproject.com/en/1.4/ref/contrib/messages/ )

Re: Django 1.4 - how to display a success message on form save

2012-06-26 Thread Sithembewena Lloyd Dube
I did do: #if form.save(): success = form.errors['success'] On Tue, Jun 26, 2012 at 2:35 PM, Sithembewena Lloyd Dube wrote: > @newkedison, thank you for the suggestion. I wish to stay on the page > without doing any redirects. > > @Jirka - thanks. I saw something about the messaging framework

Re: Django 1.4 - how to display a success message on form save

2012-06-26 Thread Sithembewena Lloyd Dube
@newkedison, thank you for the suggestion. I wish to stay on the page without doing any redirects. @Jirka - thanks. I saw something about the messaging framework and even tried one example which did not work. I ended up doing the following (which worked): In view: success = default value here

Re: Django 1.4 - how to display a success message on form save

2012-06-26 Thread Jirka Vejrazka
Hi, have you checked the messaging framework in Django? HTH Jirka -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to djang

Re: Django 1.4 - how to display a success message on form save

2012-06-26 Thread 罗健忠
you may use HttpResponseRedirect to redirect to another page to display the successful message On 26 June 2012 17:48, Sithembewena Lloyd Dube wrote: > Hi everyone, > > I have a form on which I'm calling save() and if it is successful I would > like to display 'your post has been saved' or simila

Django 1.4 - how to display a success message on form save

2012-06-26 Thread Sithembewena Lloyd Dube
Hi everyone, I have a form on which I'm calling save() and if it is successful I would like to display 'your post has been saved' or similar in the template. How would one go about that in Django 1.4? I am sifting through the docs and cannot seem to find a definitive answer. Thanks in advance.