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
>
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
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
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
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
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
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
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 ->
>
>
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
>>
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
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'])
11 matches
Mail list logo