I am now doing my query in the form's clean method, and it errors the
way I want it to. Thank you.
Although, I do feel dirty doing it this way. I feel like I should be
able to append an error to the form in the view.
On Jul 11, 3:04 pm, Andre Terra wrote:
> I feel your pain, validating forms can
I feel your pain, validating forms can be a PITA... Try reading through this
last bit of the form validation docs:
https://docs.djangoproject.com/en/dev/ref/forms/validation/#cleaning-and-validating-fields-that-depend-on-each-other
Cheers,
André Terra
On Mon, Jul 11, 2011 at 6:02 PM, Brian McKe
I have a search form that is used by a view to search for results and
then redirect to display them one at a time. If my search doesn't find
any objects matching the criteria, I'd like to display a message
saying so.
It seems natural to add this error to the search form and redisplay it
since it a
On Tue, Aug 4, 2009 at 11:17 AM, CrabbyPete wrote:
>
> I want to return an error that a user was not found. I wanted to add
> the error and have it formatted using errorlist as happens with a
> required field. So I did the following
>
> lform._errors['username'] = ErrorList("User does not exist o
I want to return an error that a user was not found. I wanted to add
the error and have it formatted using errorlist as happens with a
required field. So I did the following
lform._errors['username'] = ErrorList("User does not exist or wrong
password")
The result in lform.errors is
ErrorDict:
The reference you want is here:
http://docs.djangoproject.com/en/dev/ref/forms/validation/#form-subclasses-and-modifying-field-errors
Note particularly those first few paragraphs under 'Form subclasses
and modifying field errors', and examples below.
sdc
--~--~-~--~~~--
I think the errors attribute needs to be a list (hence the name), so
try:
form._errors['name'].append('User name already in use')
I think errors is not only a list, but an instance of
django.forms.utils.ErrorList (or any subclass of it), which controls
the way errors are displayed in the form, a
If I have a form and if form.is_valid is False
The code code in the template {{ form.name.errors}} formats the error
like this.
This field is required.
How do you add an error so it gets formatted with the surrounding
html. If a user name already exists I want to add the error message
'User na
On 1/6/06, FX <[EMAIL PROTECTED]> wrote:
>
> Hi Ian,
> Thanks for the prompt reply. (which time zone are you in?)
I live in Melbourne Australia.
>
> I made some modifications to your Django Captcha that might be useful,
> so I'm attaching the patch (generated by svn) below. The changes are:
> 1.
Hi Ian,
Thanks for the prompt reply. (which time zone are you in?)
I made some modifications to your Django Captcha that might be useful,
so I'm attaching the patch (generated by svn) below. The changes are:
1. modified to make use of tempfile.mkdtemp() and tempfile.tempdir
instead of "/tmp" to m
Hi Feiyu.
the problem is the captcha validation is the manipulator out of scope
when the the validation is run.
there are 2 choices.
1. the captcha view should throw a validation error (not a 404)..
thats my bug, and I will fix it shortly. This will mean you will get
the error message on your
Folks,
I'm working on an application that makes use of Django Captcha. I want
to be able to display the captcha validation error along with other
errors on the form after post, and here is my view code (please note
the story model is the same as django.models.storys so the manipulator
is django.mo
12 matches
Mail list logo