Monday, April 27, 2020

Re: AttributeError with forms

It's not strange. You can't access to an attribute of a form class directly. Remember how do you define the form in a view. You're passing arguments such as data=request.POST. You're trying to access an undefined attribute. Because It's a form class and needs input.

Try to print t.__dict__  you'll get a dictionary of that class. But If you really need to access to the attribute like this, use t['date']

DimGo <proskuryakov931@gmail.com>, 27 Nis 2020 Pzt, 18:29 tarihinde şunu yazdı:
Why is this this strange error?

--
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/7a2089af-344a-479d-bf7c-8a943973159b%40googlegroups.com.

--
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/CAMsyPm_ck-hhC-P_FGz3vwk_fgKQWAy9rx6WpAh7AE1Gr08iqg%40mail.gmail.com.

No comments:

Post a Comment