Re: Django - always getting False in form.is_valid()

2019-04-21 Thread Sipum Mishra
Hi Jani, the above solution is not working, still having the same problem. and that completed field is used later for cross_off and uncross the item in list. On Sun, 21 Apr 2019 at 17:36, Jani Tiainen wrote: > Hi, > > required attribute works in forms, not in models. For models fields that >

Re: Django - always getting False in form.is_valid()

2019-04-21 Thread Jani Tiainen
Hi, required attribute works in forms, not in models. For models fields that are not required in forms you need to use blank=True. Though that's not the right solution. Why are you including "completed" field in a form (which you validate for user input) if you are not going to have such a

Re: Django - always getting False in form.is_valid()

2019-04-21 Thread Sipum Mishra
if i do changes as above in model then it throws error like - class List(models.Model): File "F:\django\to_do_list\todo\models.py", line 6, in List completed = models.BooleanField(required=False) TypeError: __init__() got an unexpected keyword argument 'required' On Sun, 21 Apr 2019 at

Re: Django - always getting False in form.is_valid()

2019-04-21 Thread Sipum Mishra
Jani, Do you mean I need to change completed field in model like as below ? completed = models.BooleanField(default=False,required=False) On Sun, 21 Apr 2019 at 17:23, Sipum Mishra wrote: > Hi Jani, > form.errors gives error as - > > itemThis field is > required.< > /li> > > can u plz tell me

Re: Django - always getting False in form.is_valid()

2019-04-21 Thread Sipum Mishra
Hi Jani, form.errors gives error as - itemThis field is required.< /li> can u plz tell me where i did wrong? On Sun, 21 Apr 2019 at 16:43, Jani Tiainen wrote: > completed is a required field and you're not passing any value with it. If > you print form.errors you would should see that it

Re: Django - always getting False in form.is_valid()

2019-04-21 Thread Jani Tiainen
completed is a required field and you're not passing any value with it. If you print form.errors you would should see that it complains about "completed" "this field is required" Note that providing default value in a model is not same as making field optional. On Fri, Apr 19, 2019 at 2:05 PM

Re: Django - always getting False in form.is_valid()

2019-04-20 Thread John Bagiliko
Drop the html codes here please. Let one try it actually. It's difficult to debug like this. On Sat, Apr 20, 2019, 5:35 PM Sipum Mishra wrote: > Hi Vineeth, > > when I am trying to add 'add testing' through html form for todo list app > getting this above form.is_valid() always False. > > On

Re: Django - always getting False in form.is_valid()

2019-04-20 Thread Sipum Mishra
Hi Vineeth, when I am trying to add 'add testing' through html form for todo list app getting this above form.is_valid() always False. On Sat, 20 Apr 2019 at 23:02, Sipum Mishra wrote: > Hi Vineeth, > > please find below is the output -> > >

Re: Django - always getting False in form.is_valid()

2019-04-20 Thread Sipum Mishra
Hi Vineeth, please find below is the output -> On Fri, 19 Apr 2019 at 19:04, vineeth sagar wrote: > can you please post, request.POST output? > > On Fri, 19 Apr 2019, 16:34 Sipum Mishra, wrote: > >> Hi All, >> >> I am always getting - form.is_valid returning False. kindly check where I >>

Re: Django - always getting False in form.is_valid()

2019-04-19 Thread vineeth sagar
can you please post, request.POST output? On Fri, 19 Apr 2019, 16:34 Sipum Mishra, wrote: > Hi All, > > I am always getting - form.is_valid returning False. kindly check where I > am doing wrong. > please find below code. > > > views.py > --- > def home(request): > > if request.method

Django - always getting False in form.is_valid()

2019-04-19 Thread Sipum Mishra
Hi All, I am always getting - form.is_valid returning False. kindly check where I am doing wrong. please find below code. views.py --- def home(request): if request.method == 'POST': form = ListForm(request.POST or None) print(form.is_valid(), "-->",request.POST['Item'])