Re: How to clear wrong form data (e.g password field), but still show error?

2010-09-17 Thread Karen Tracey
On Thu, Sep 16, 2010 at 10:55 PM, Brian Neal  wrote:

> On Sep 16, 7:37 pm, Karen Tracey  wrote:
> >
> > Use this widget for the field:
> >
> > http://docs.djangoproject.com/en/1.2/ref/forms/widgets/#django.forms
> >
> > with render_value=False
> >
> Note that the docs indicate the default value for render_value is True
> but in the code it is False:
>
>
> http://code.djangoproject.com/browser/django/trunk/django/forms/widgets.py#L232


That was a recent change (http://code.djangoproject.com/changeset/13498) and
is why I pointed to the 1.2 docs instead of the dev ones in answering. For
anyone using an official release, it is necessary to pass render_value=False
to get the desired behavior; for anyone using current trunk, it is not
necessary but also not harmful. For a while it will be safest for anyone
really desiring this behavior to pass render_value=False, that way the code
will work as intended on both current and older levels of Django.

Karen
-- 
http://tracey.org/kmt/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to clear wrong form data (e.g password field), but still show error?

2010-09-16 Thread Evgeny
perfect, Thanks!

On Sep 16, 7:55 pm, Brian Neal  wrote:
> On Sep 16, 7:37 pm, Karen Tracey  wrote:
>
> > Use this widget for the field:
>
> >http://docs.djangoproject.com/en/1.2/ref/forms/widgets/#django.forms
>
> > with render_value=False
>
> Note that the docs indicate the default value for render_value is True
> but in the code it is False:
>
> http://code.djangoproject.com/browser/django/trunk/django/forms/widge...

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to clear wrong form data (e.g password field), but still show error?

2010-09-16 Thread Brian Neal
On Sep 16, 9:55 pm, Brian Neal  wrote:
> On Sep 16, 7:37 pm, Karen Tracey  wrote:
>
> > Use this widget for the field:
>
> >http://docs.djangoproject.com/en/1.2/ref/forms/widgets/#django.forms
>
> > with render_value=False
>
> Note that the docs indicate the default value for render_value is True
> but in the code it is False:
>
> http://code.djangoproject.com/browser/django/trunk/django/forms/widgets.py#L232

Oh sorry, the documentation is correct in the development docs:

http://docs.djangoproject.com/en/dev/ref/forms/widgets/#django.forms.PasswordInput

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to clear wrong form data (e.g password field), but still show error?

2010-09-16 Thread Brian Neal
On Sep 16, 7:37 pm, Karen Tracey  wrote:
>
> Use this widget for the field:
>
> http://docs.djangoproject.com/en/1.2/ref/forms/widgets/#django.forms
>
> with render_value=False
>
Note that the docs indicate the default value for render_value is True
but in the code it is False:

http://code.djangoproject.com/browser/django/trunk/django/forms/widgets.py#L232

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to clear wrong form data (e.g password field), but still show error?

2010-09-16 Thread Karen Tracey
On Thu, Sep 16, 2010 at 7:20 PM, Evgeny  wrote:

> Hello,
>
> I know that this has been asked before, and the answer seemed to be
> - display the wrong data back to the user along with the error
> message.
>
> However, this does not really work with password fields, because there
> is nothing really to display.
> Let's say the entered password was too short or two passwords did not
> match - all you'll see is the equal number of asterisks.
>
> In this situation I'd like to clear the fields, but display the error
> message,
> otherwise user has to clear the field himself/herself, which I think
> is an unnecessary extra step.
>
>
Use this widget for the field:

http://docs.djangoproject.com/en/1.2/ref/forms/widgets/#django.forms.PasswordInput

with render_value=False

Karen
-- 
http://tracey.org/kmt/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.