Re: [Django] #15126: Misleading error in ModelForm

2013-06-08 Thread Django
#15126: Misleading error in ModelForm
-+-
 Reporter:  ingo@…   |Owner:  nobody
 Type:  Uncategorized|   Status:  closed
Component:  contrib.admin|  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  modelform fields | Triage Stage:
  attributeerror widget subset   |  Unreviewed
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  1|UI/UX:  1
-+-

Comment (by ogpcludi ):

 1

-- 
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/073.24073e96b01908e1f461c177b01c4019%40djangoproject.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #15126: Misleading error in ModelForm

2013-06-08 Thread Django
#15126: Misleading error in ModelForm
-+-
 Reporter:  ingo@…   |Owner:  nobody
 Type:  Uncategorized|   Status:  closed
Component:  contrib.admin|  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  modelform fields | Triage Stage:
  attributeerror widget subset   |  Unreviewed
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  1|UI/UX:  1
-+-

Comment (by ogpcludi ):

 1

-- 
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/073.d2973a0190d0b7c64ae48bf44500fa86%40djangoproject.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #15126: Misleading error in ModelForm

2013-06-08 Thread Django
#15126: Misleading error in ModelForm
-+-
 Reporter:  ingo@…   |Owner:  nobody
 Type:  Uncategorized|   Status:  closed
Component:  contrib.admin|  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  modelform fields | Triage Stage:
  attributeerror widget subset   |  Unreviewed
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  1
Easy pickings:  1|UI/UX:  1
-+-
Changes (by ogpcludi ):

 * needs_better_patch:  0 => 1
 * component:  Forms => contrib.admin
 * needs_tests:  0 => 1
 * version:  1.2 => master
 * easy:  0 => 1
 * needs_docs:  0 => 1
 * ui_ux:  0 => 1
 * type:  Bug => Uncategorized
 * stage:  Accepted => Unreviewed


Comment:

 1

-- 
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/073.f06869b27930a125fac3e044f97272c9%40djangoproject.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #15126: Misleading error in ModelForm

2013-04-07 Thread Django
#15126: Misleading error in ModelForm
-+-
 Reporter:  ingo@…   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Forms|  Version:  1.2
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  modelform fields | Triage Stage:  Accepted
  attributeerror widget subset   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by Jannis Leidel ):

 In [changeset:"b5c0b3d1d9328e67baa9c7cc98ac38be3d94a0ec"]:
 {{{
 #!CommitTicketReference repository=""
 revision="b5c0b3d1d9328e67baa9c7cc98ac38be3d94a0ec"
 Merge pull request #1000 from bmispelon/ticket-15126

 Fix #15126: Better error message when passing invalid options to
 ModelFo...
 }}}

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #15126: Misleading error in ModelForm

2013-04-07 Thread Django
#15126: Misleading error in ModelForm
-+-
 Reporter:  ingo@…   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Forms|  Version:  1.2
 Severity:  Normal   |   Resolution:  fixed
 Keywords:  modelform fields | Triage Stage:  Accepted
  attributeerror widget subset   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by Baptiste Mispelon ):

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


Comment:

 In [changeset:"f9dc1379b874f80694a80e95f0f266a3d42f7368"]:
 {{{
 #!CommitTicketReference repository=""
 revision="f9dc1379b874f80694a80e95f0f266a3d42f7368"
 Fix #15126: Better error message when passing invalid options to
 ModelForm.Meta.
 }}}

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #15126: Misleading error in ModelForm

2013-04-07 Thread Django
#15126: Misleading error in ModelForm
-+-
 Reporter:  ingo@…   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Forms|  Version:  1.2
 Severity:  Normal   |   Resolution:
 Keywords:  modelform fields | Triage Stage:  Accepted
  attributeerror widget subset   |  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by bmispelon):

 * cc: bmispelon@… (added)
 * needs_better_patch:  1 => 0


Comment:

 I fixed up the proposed patch a little and brought it up to date,
 adressing some of the points made above.

 I opted not to put the validation inside the `ModelFormOptions.__init__`,
 so that I would have access to the ModelForm's class in order to provide a
 more helpful message.

 Here's the corresponding pull request:
 https://github.com/django/django/pull/1000

 I added two extra tests (on top of the two new ones for this particular
 feature):

 * Make sure that a `FieldError` is raised when passing an inexisting field
 to `Meta.fields`.
 * Make sure that no errors are raised when passing an inexisting field to
 `Meta.exclude`.

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #15126: Misleading error in ModelForm

2011-09-15 Thread Django
#15126: Misleading error in ModelForm
-+-
   Reporter:  ingo@… |  Owner:  nobody
   Type:  Bug| Status:  new
  Milestone: |  Component:  Forms
Version:  1.2|   Severity:  Normal
 Resolution: |   Keywords:  modelform fields
   Triage Stage:  Accepted   |  attributeerror widget subset
Needs documentation:  0  |  Has patch:  1
Patch needs improvement:  1  |Needs tests:  0
  UI/UX:  0  |  Easy pickings:  0
-+-
Changes (by ptone):

 * needs_better_patch:  0 => 1
 * ui_ux:   => 0
 * easy:   => 0


Comment:

 I think the test for str is reasonable.

 I think this would be better implemented in the __init__ of
 ModelFormOptions

 also the test should use assertRaises to actually test that the assertion
 is raised on instantiation, rather than fail after a class is defined,
 which doesn't actually test your code.

 A couple minor points:

 * I believe you don't need to test for None, isinstance should suffice

 * the error should be that the option should be a iterable of strings, not
 a single string - list is too specific here

 * You don't need to determine the type of the errant value, as you only
 raise the exception for str type anyway.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15126: Misleading error in ModelForm

2011-04-18 Thread Django
#15126: Misleading error in ModelForm
-+-
   Reporter:  ingo@… |Owner:  nobody
   Type:  Bug|   Status:  new
  Milestone: |Component:  Forms
Version:  1.2| Severity:  Normal
 Resolution: | Keywords:  modelform fields
   Triage Stage:  Accepted   |  attributeerror widget subset
Needs documentation:  0  |Has patch:  1
Patch needs improvement:  0  |  Needs tests:  0
-+-
Changes (by jaddison):

 * type:   => Bug
 * severity:   => Normal


-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15126: Misleading error in ModelForm

2011-02-01 Thread Django
#15126: Misleading error in ModelForm
---+
   Reporter:  ingo@…   | Owner:  nobody 
  
 Status:  new  | Milestone: 
  
  Component:  Forms|   Version:  1.2
  
 Resolution:   |  Keywords:  modelform fields 
attributeerror widget subset
   Triage Stage:  Accepted | Has patch:  1  
  
Needs documentation:  0|   Needs tests:  0  
  
Patch needs improvement:  0|  
---+
Changes (by bpeschier):

  * has_patch:  0 => 1


-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15126: Misleading error in ModelForm

2011-02-01 Thread Django
#15126: Misleading error in ModelForm
---+
   Reporter:  ingo@…   | Owner:  nobody 
  
 Status:  new  | Milestone: 
  
  Component:  Forms|   Version:  1.2
  
 Resolution:   |  Keywords:  modelform fields 
attributeerror widget subset
   Triage Stage:  Accepted | Has patch:  0  
  
Needs documentation:  0|   Needs tests:  0  
  
Patch needs improvement:  0|  
---+

Comment (by bpeschier):

 The above patch tests both fields and exclude for the error. It also
 includes an extension of the forms-testsuite which tests whether or not
 the validation is done.

 I have two comments with the patch; it would be nice if somebody would
 reflect on them

 1. The patch tests specifically for 'str' because I did not want to impair
 fancy gizmos and create a regression (the docs are not specific on what
 kind of list fields should be). Testing for string tests for the common
 mistake without restricting other iterables

 2. I was not that familiar with testing exceptions thrown by class
 definitions, so I would appreciate a second opinion on them :-)

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15126: Misleading error in ModelForm

2011-01-21 Thread Django
#15126: Misleading error in ModelForm
--+-
  Reporter:  i...@orgizm.net  | Owner:  nobody  
 
Status:  new  | Milestone:  
 
 Component:  Forms|   Version:  1.2 
 
Resolution:   |  Keywords:  modelform fields 
attributeerror widget subset
 Stage:  Accepted | Has_patch:  0   
 
Needs_docs:  0|   Needs_tests:  0   
 
Needs_better_patch:  0|  
--+-
Changes (by russellm):

  * needs_better_patch:  => 0
  * stage:  Unreviewed => Accepted
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 The "single-item tuple" bug is a frequent cause of trouble, especially for
 newcomers to Python; however, in this case, we are in a position to raise
 an error.

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #15126: Misleading error in ModelForm

2011-01-20 Thread Django
#15126: Misleading error in ModelForm
---+
 Reporter:  i...@orgizm.net|   Owner:  
nobody
   Status:  new|   Milestone:   
 
Component:  Forms  | Version:  1.2  
 
 Keywords:  modelform fields attributeerror widget subset  |   Stage:  
Unreviewed
Has_patch:  0  |  
---+
 Hi,

 setting the fields attribute in the Meta-class of a ModelForm to a tuple
 with only one value specified (without the trailing ',') results in a
 string. After expiriencing hours of bugtracking i mentioned this fact. The
 django code in this case doesnt exactly point out, whats causing the
 problem, because a string as a fields-attribute value also is an iterable
 object, so it iterates over every single character of this string(handling
 every charactar as a field) and finaly raises a AttributeError ('ΝοneType'
 object has no attribute 'widget') when calling the is_valid() method.
 It was unnecessarily complicated to recognize the cause for this
 exception. After this i found, that the python-docs
 (http://docs.python.org/tutorial/datastructures.html#tuples-and-sequences)
 also mention this 'ugly' issuse to be fixed by appending a ','.
 Perhaps the django-code should help people saving thier time in this case
 and evaluate if the fields-attribute contains a string or a valid tuple.
 One solution would be to convert a string to a list or to raise a more
 meanigful error. Another approach could be a more explicit hint in the
 ModelForm-Documentation(by mentioning the error it would cause not
 appending a ',').

-- 
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.