'verifyform' Object Has No Attribute 'reception'
I have a page where it allows the user to enter the reception number, so when the user enter the reception number, it should verify with the database if the reception number exist,
Solution 1:
form = AddForm(request.POST or None)
This line says that form
can also be None
if object is not found.
You're trying to run this line if form.reception == Photo.reception:
before checking if form is valid or None
.
To solve this problem, do something like:
if form:
if form.reception == Photo.reception:
........
else(optional):
print("the object doesn't exist")
Solution 2:
Change form.reception
to form.cleaned_data["reception"]
Post a Comment for "'verifyform' Object Has No Attribute 'reception'"