Re: [Django] #21654: Document a use-case for `Form.errors.as_data()`

2014-02-14 Thread Django
#21654: Document a use-case for `Form.errors.as_data()`
--+
 Reporter:  selwin|Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  closed
Component:  Documentation |  Version:  master
 Severity:  Normal|   Resolution:  fixed
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Tim Graham ):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"2e4200b5c7cb4887b7034bb5dcbbd354e4698f27"]:
 {{{
 #!CommitTicketReference repository=""
 revision="2e4200b5c7cb4887b7034bb5dcbbd354e4698f27"
 Fixed #21654 -- Documented a use-case for Form.errors.as_data().

 Thanks selwin for the suggestion.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.de092a431ec231cd588a14f4ccea384f%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21654: Document a use-case for `Form.errors.as_data()`

2014-02-13 Thread Django
#21654: Document a use-case for `Form.errors.as_data()`
--+
 Reporter:  selwin|Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Documentation |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by loic84):

 * has_patch:  0 => 1


Comment:

 PR https://github.com/django/django/pull/2273.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.1fadb9248880525f9a18d080c856951d%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21654: Document a use-case for `Form.errors.as_data()`

2014-01-18 Thread Django
#21654: Document a use-case for `Form.errors.as_data()`
--+
 Reporter:  selwin|Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Documentation |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by timo):

 * component:  Forms => Documentation


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.84109c22618ca829df0614346946a52a%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21654: Document a use-case for `Form.errors.as_data()`

2014-01-18 Thread Django
#21654: Document a use-case for `Form.errors.as_data()`
--+
 Reporter:  selwin|Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Forms |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by timo):

 * easy:  1 => 0


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.4de16693b1e84c519e01154d2ba2157a%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21654: Document a use-case for `Form.errors.as_data()`

2014-01-13 Thread Django
#21654: Document a use-case for `Form.errors.as_data()`
--+
 Reporter:  selwin|Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Forms |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  1 |UI/UX:  0
--+

Comment (by loic84):

 - `as_data()` returns the `ValidationError` instances, you need that if
 you want to do anything meaningful with the errors other than just
 displaying it.

 - `form.errors` returns the **rendered** errors which are basically blobs
 of text. At that point all the metadata is gone, no error code, no params,
 and the string has already been translated. All you can do is display this
 text; you can't manipulate it since you can't identify the individual
 errors anymore, especially if translation is involved.

 Ideally `form.errors` would have always returned `ValidationError`
 instances and `as_data()` wouldn't exist, but that would have been
 backward incompatible, so we had to do it the other way around.

 Use-cases include, serializing the errors (say in xml or a custom json),
 rewrite or remove a given error message, etc. Basically, anytime you need
 an answer to the question "what is this error message?".

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.d4ef02ecfa37310eeb0d5f06d7beb57e%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21654: Document a use-case for `Form.errors.as_data()` (was: Better name for `Form.errors.as_data()`)

2014-01-13 Thread Django
#21654: Document a use-case for `Form.errors.as_data()`
--+
 Reporter:  selwin|Owner:  nobody
 Type:  Cleanup/optimization  |   Status:  new
Component:  Forms |  Version:  master
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Accepted
Has patch:  0 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  1 |UI/UX:  0
--+
Changes (by bmispelon):

 * stage:  Unreviewed => Accepted
 * easy:  0 => 1


Comment:

 I agree with Tim that a documentation update would help clear up the
 confusion.

 Why would a user want to use `form.errors.as_data()` instead of just
 `form.errors`; is there a use-case for it?

 I'm accepting the ticket on this basis.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.886831c7e71c3a89ba7b5ca80c16e392%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.