Is there any way that I can put errors in the response that aren't
linked with form fields?
For example, in an authentication page... if the authentication fails,
I don't want to link an error to either the user or password field...
it should be linked to the page. I guess what I'm looking for is
something like 'form.generic.errors'
Thanks in advance,
--Ben
http://www.djangoproject.com/documentation/forms/
Do a find on "if form.has_errors" to see a template example
containing general form errors as well as field specific
form errors.
Let me know if you need more info.
thanks,
raman
==========
{% if form.has_errors %}
<h2>Please correct the following error{{ form.error_dict|pluralize
}}:</h2>
{% endif %}
...
{% if form.name.errors %}*** {{ form.name.errors|join:", " }}{% endif
%}
==========
As I understand it, this block is only determining if there are errors
on the page and if there are one or many. Then it progresses into
per-field errors.
I'm looking more for:
==========
{% if form.has_errors %}
<h2>Please correct the following error{{ form.error_dict|pluralize
}}:</h2>
{% if form.generic.errors %}*** {{ form.generic.errors|join:", " }}{%
endif %}
{% endif %}
...
==========
I could do this by defining a 'generic' field and manually assigning
errors to it, but that seems like a kludge.
Thanks for your feedback so far,
--Ben
There is currently a discussion[1] going on in the dev-list regarding
a proposal for reworking form validation. I don't recall if such a
thing was part of the proposal, but now's the time to add your input.
[1]: http://groups.google.com/group/django-developers/browse_thread/thread/7eceb616b251cbd0/
--
----
Waylan Limberg
way...@gmail.com