Re: Success Message after Submitting a form

2020-04-24 Thread Ahmed Khairy
Thank you Ramadan Kareem On Friday, April 24, 2020 at 12:11:09 AM UTC-4, mohamed khaled wrote: > > just use SuccessMessageMixin > > from django.contrib.messages.views import SuccessMessageMixin > > class PostCreateView(LoginRequiredMixin,SuccessMessageMixin, CreateView): > model = Post > f

Re: Success Message after Submitting a form

2020-04-23 Thread mohamed khaled
just use SuccessMessageMixin from django.contrib.messages.views import SuccessMessageMixin class PostCreateView(LoginRequiredMixin,SuccessMessageMixin, CreateView): model = Post fields = ['caption', 'design'] template_name = "post_form.html" success_url = '/score' success_mess

Success Message after Submitting a form

2020-04-23 Thread Ahmed Khairy
I have created this class with the success message but I am not receiving the success message I requested, other pages are showing them but this one is not What might be wrong? In the views: class PostCreateView(LoginRequiredMixin, CreateView): model = Post fields = ['caption', 'desig

Re: Submitting a form

2009-07-29 Thread When ideas fail
Thank you On 30 July, 00:04, Adam Yee wrote: > Use the model's verbose field > namehttp://docs.djangoproject.com/en/dev/topics/db/models/#id2 > > On Jul 29, 3:55 pm, When ideas fail wrote: > > > Is there a way i can change the label for a field in the model form? > > > On 29 July, 21:44, When

Re: Submitting a form

2009-07-29 Thread Adam Yee
Use the model's verbose field name http://docs.djangoproject.com/en/dev/topics/db/models/#id2 On Jul 29, 3:55 pm, When ideas fail wrote: > Is there a way i can change the label for a field in the model form? > > On 29 July, 21:44, When ideas fail wrote: > > > > > Ok thanks seems to work now. >

Re: Submitting a form

2009-07-29 Thread When ideas fail
Is there a way i can change the label for a field in the model form? On 29 July, 21:44, When ideas fail wrote: > Ok thanks seems to work now. > > On 29 July, 21:27, Daniel Roseman wrote: > > > On Jul 29, 9:17 pm, When ideas fail wrote: > > > > I've created a model form and I was wondering what

Re: Submitting a form

2009-07-29 Thread When ideas fail
Is there a way i can change the label for a field in the model form? On 29 July, 21:44, When ideas fail wrote: > Ok thanks seems to work now. > > On 29 July, 21:27, Daniel Roseman wrote: > > > On Jul 29, 9:17 pm, When ideas fail wrote: > > > > I've created a model form and I was wondering what

Re: Submitting a form

2009-07-29 Thread When ideas fail
Ok thanks seems to work now. On 29 July, 21:27, Daniel Roseman wrote: > On Jul 29, 9:17 pm, When ideas fail wrote: > > > > > I've created a model form and I was wondering what the correct way to > > save this was. I've tried adapting the view from the standard django > > forms docs but maybe it

Re: Submitting a form

2009-07-29 Thread Daniel Roseman
On Jul 29, 9:17 pm, When ideas fail wrote: > I've created a model form and I was wondering what the correct way to > save this was. I've tried adapting the view from the standard django > forms docs but maybe it should be different? > > This is what i have in my view (it says contact form but its

Submitting a form

2009-07-29 Thread When ideas fail
I've created a model form and I was wondering what the correct way to save this was. I've tried adapting the view from the standard django forms docs but maybe it should be different? This is what i have in my view (it says contact form but its a form that should save contacts in a db): class Co