Re: [Django] #17591: USSocialSecurityNumberField doesn't validate the same when entered without hypens

2012-02-07 Thread Django
#17591: USSocialSecurityNumberField doesn't validate the same when entered 
without
hypens
-+-
 Reporter:  aaron.l.madison@…|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  contrib.localflavor  |  Version:  1.3
 Severity:  Normal   |   Resolution:
 Keywords:  localflavor  | Triage Stage:  Accepted
  ussocialsecuritynumberfield|  Needs documentation:  1
Has patch:  1|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  1|
-+-

Comment (by aaron.l.madison@…):

 sorry for the spam... accidentally posted the patch and my comment as
 anonymous.

-- 
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] #17591: USSocialSecurityNumberField doesn't validate the same when entered without hypens

2012-02-07 Thread Django
#17591: USSocialSecurityNumberField doesn't validate the same when entered 
without
hypens
-+-
 Reporter:  aaron.l.madison@…|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  contrib.localflavor  |  Version:  1.3
 Severity:  Normal   |   Resolution:
 Keywords:  localflavor  | Triage Stage:  Accepted
  ussocialsecuritynumberfield|  Needs documentation:  1
Has patch:  1|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  1|
-+-

Comment (by anonymous):

 Thanks for your feedback. I've attached another patch.

 To me the small methods are much less about DRY and much more about
 readability. A method that clearly says what it does doesn't need a
 comment to say what it does. Personal preference I'm sure.

-- 
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] #17591: USSocialSecurityNumberField doesn't validate the same when entered without hypens

2012-02-06 Thread Django
#17591: USSocialSecurityNumberField doesn't validate the same when entered 
without
hypens
-+-
 Reporter:  aaron.l.madison@…|Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  contrib.localflavor  |  Version:  1.3
 Severity:  Normal   |   Resolution:
 Keywords:  localflavor  | Triage Stage:  Accepted
  ussocialsecuritynumberfield|  Needs documentation:  1
Has patch:  1|  Patch needs improvement:  1
  Needs tests:  0|UI/UX:  0
Easy pickings:  1|
-+-
Changes (by lrekucki):

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


Comment:

 Few notes:

 * Python 2.5 (the minimal version supported right now) doesn't have
 "{{{with}}}" by default, you need {{{from __future__ import
 with_statement}}}. It also doesn't have the {{{.format()}}} method, so
 that won't work,
 * The tests are repetitive: you both added a case to the dictionary and a
 method. Just add all invalid cases to the dictionary, to keep it simple,
 * You don't have to write "{{{bool(area == '666')}}}": "{{{area ==
 '666'}}}" is exactly the same. Same for {{{any([])}}} - that just a
 needlesly complicated "{{{or}}}" expression,
 * The {{{zeros_re}}} - imho, there was nothing wrong with the previous
 check for zeroes, no reason to change it for a regexp,
 * Get rid of "_is_all_zeros()", "_raise_invalid", etc. methods. It doesn't
 save typing nor is more DRY, just makes the code longer.

 If you want the "no_hypen" flag included, you also need to update the
 documentation for this field.

-- 
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] #17591: USSocialSecurityNumberField doesn't validate the same when entered without hypens

2012-01-25 Thread Django
#17591: USSocialSecurityNumberField doesn't validate the same when entered 
without
hypens
-+-
 Reporter:   |  Owner:  nobody
  aaron.l.madison@…  | Status:  new
 Type:  Bug  |Version:  1.3
Component:   |   Keywords:  localflavor
  contrib.localflavor|  ussocialsecuritynumberfield
 Severity:  Normal   |  Has patch:  1
 Triage Stage:   |  UI/UX:  0
  Unreviewed |
Easy pickings:  1|
-+-
 In the us localflavor USSocialSecurityNumberField, if you enter an SSN
 without hyphens, the 'Woolworth' validations aren't run properly because
 they're explicity '078-05-1120' and '219-009-' instead of checking
 against the parts.

 I refactored the field and created a patch that fixes it, plus added much
 better tests (in my opinion... added a test for each scenario).

 Lastly, sometimes a user might NOT want to force the output to xxx-xx-
 . It might be useful to just leave it without hyphens. (in my case,
 need to pass ssn to a credit report service and will never need the dashes
 and I don't want to strip them out every time.) So, I added an optional
 keyword argument 'no_hyphen' to the ssn field which just forces the output
 to not have hyphens.

 Please include or give feedback on the patch.

 Thanks!

-- 
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.