Regarding the 'improving error reporting' part, I have started with some
issues which may be comparatively easier:
Improving error reporting
django.forms
#15069
In forms.py:
self._errors[name] = self.error_class(e.messages)
When the list of errors is created, the value of the wrong/invalid field
can be shown.
Some extra information could be shown, based upon the type of error.
eg. In FileField : In case of invalid, the encoding-type problem could be
explained with better message/suggestion
In DateTimeField : Format/Example of correct datetime object or errors
could be pointed out more explicitly.
Also such cases in other Field subclasses
Also some more type of errors could be added.
#13091
A patch was written for a part of this(which was decided to be dealt in
another ticket) which was merged. But the major problem remained unsolved.
Later a patch was written for this too, but as summarized by a core-dev,
that will lead to another set of bugs.
I did go through the patch and realized the situation, there were some
suggesstions that I too believe will work well:
Just fix this in the particular case of the admin. This could possibly be
done by adding a manual call to full_clean once the instance is fully
populated (might be a bit ugly getting any ValidationErrors back into the
not-valid code path).
Add a warning to the above section of the docs (on partial ModelForms)
about this issue and how to work around it in your own forms.
django.http
If Http404 is returned instead of raised(because it is in the same file
where other response classes have been defined i.e.
django/http/response.py), then there is a problem of AttributeError.
One solution is renaming it to more clear name like Http404Exception, but
we would have to replace it at several places.
Ithink a better solution could be to check this error in
django/core/handlers/base.py .We can check the called response object for
this, and then do something which is appropriate. I think we can check for
Http404, if it is returned and convert the response to HttpResponseNotFound.
Feedback Needed.
Working on other issues, will be posting soon.
Regards,
Anubhav Joshi
IIT Patna
--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/8526ac55-76cb-426f-ba70-b7d918f70a07%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.