Thursday, April 30, 2020

Re: AttributeError



понедельник, 27 апреля 2020 г., 18:29:44 UTC+3 пользователь DimGo написал:
from django import forms
from django.core.exceptions import ValidationError

class SearchProduct(forms.Form):
 text
=forms.CharField(label='Search ')
 date
=forms.DateField(required=False)
 
t
= SearchProduct()
print(t.date)

Error:

AttributeError: 'SearchProduct' object has no attribute 'date'



why is there this error? How to fix it?
 
ff
 


Снимок экрана от 2020-04-30 12-50-05.png

Снимок экрана от 2020-04-30 12-50-09.png

Code was changed a bit, but the main problem is same

This is my html:

Снимок экрана от 2020-04-30 12-54-05.png

Снимок экрана от 2020-04-30 12-54-03.png



 

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/010b4f9c-cf94-4517-894f-649f8693aed2%40googlegroups.com.

No comments:

Post a Comment