Index: django/contrib/localflavor/ni/ni_departaments.py
===================================================================
--- django/contrib/localflavor/ni/ni_departaments.py	(revisión: 0)
+++ django/contrib/localflavor/ni/ni_departaments.py	(revisión: 0)
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+
+""" 
+An alphabetical list of departaments for use as `choices` 
+in a formfield., 
+
+Source: http://es.wikipedia.org/wiki/Departamentos_de_Nicaragua 
+The numbers are used officialy in goverment institutions.
+
+This exists in this standalone file so that it's only imported into memory 
+when explicitly needed. 
+""" 
+from django.utils.translation import ugettext_lazy as _
+
+DEPARTAMENT_CHOICES = ( 
+    (50, _(u'Boaco')), 
+    (75, _(u'Carazo')), 
+    (30, _(u'Chinandega')), 
+    (65, _(u'Chontales')), 
+    (25, _(u'Estelí')), 
+    (70, _(u'Granada')), 
+    (10, _(u'Jinotega')), 
+    (35, _(u'León')), 
+    (20, _(u'Madriz')), 
+    (55, _(u'Managua')), 
+    (60, _(u'Masaya')), 
+    (40, _(u'Matagalpa')), 
+    (5, _(u'Nueva Segovia')), 
+    (80, _(u'Rivas')), 
+    (85, _(u'Río San Juan')), 
+    (91, _(u'Región Autónoma del Atlántico Norte(RAAN)')), 
+    (93, _(u'Región Autónoma del Atlántico Sur(RAAS)')), 
+)
+
Index: django/contrib/localflavor/ni/__init__.py
===================================================================
Index: django/contrib/localflavor/ni/forms.py
===================================================================
--- django/contrib/localflavor/ni/forms.py	(revisión: 0)
+++ django/contrib/localflavor/ni/forms.py	(revisión: 0)
@@ -0,0 +1,69 @@
+"""
+Nicaragua-specific Form helpers
+"""
+
+from django.forms import ValidationError
+from django.forms.fields import  RegexField, Select, EMPTY_VALUES
+from django.forms.util import smart_unicode
+from django.utils.translation import ugettext_lazy as _
+import re
+
+
+class NIPhoneNumberField(RegexField):
+    """
+    Nicaraguan phone number field. 
+    NOTE: Nicaragua will have 8 digits number starting on April 1st so I added 8 digits.
+    """
+    default_error_messages = {
+        'invalid': u'Phone numbers must be in the format  XXX-XXXX or XXXXXXX.',
+    }
+
+    def __init__(self, *args, **kwargs):
+        super(NIPhoneNumberField, self).__init__(r'^[ 0-9\-]+$',
+                max_length = None, min_length = None, *args, **kwargs)
+
+    def clean(self, value):
+        """
+        Validates the input and returns a string with only numbers.
+        Returns an empty string for empty values
+        """
+        if value in EMPTY_VALUES:
+            return u''
+
+        v = super(NIPhoneNumberField, self).clean(value)
+        v = v.replace('-', '')
+        v = v.replace(' ', '')
+        if (len(v) == 8):
+            return v
+        raise ValidationError(self.default_error_messages['invalid'])
+    
+class NIDepartamentSelect(Select):
+    """
+    A Select widget that uses a list of Nicaraguan departaments.
+    """
+    def __init__(self, attrs = None):
+        from django.contrib.localflavor.ni.ni_departaments import DEPARTAMENT_CHOICES
+        super(NIDepartamentSelect, self).__init__(attrs, choices=DEPARTAMENT_CHOICES)
+
+class NICedulaNumberField(RegexField):
+    """
+    Cedula number(cedula is the identification document to
+    vote and make legal stuff in Nicaragua.
+    
+    The format is 999-999999-9999A where 9 is a number and A is a letter. 
+    """
+    default_error_messages = {
+        'invalid': _('Enter a valid Cedula number in XXX-XXXXXX-XXXXX format.'),
+    }
+    
+    def __init__(self, *args, **kwargs):
+        super(NICedulaNumberField, self).__init__(r'^(\d{3})-(\d{6})-(\d{4}[a-zA-z])$',
+                max_length = None, min_length = None, *args, **kwargs)
+
+
+    def clean(self, value):
+        value = super(NICedulaNumberField, self).clean(value)
+        if value in EMPTY_VALUES:
+            return u''
+        else:
+            return value
Index: tests/regressiontests/forms/localflavor/ni.py
===================================================================
--- tests/regressiontests/forms/localflavor/ni.py	(revisión: 0)
+++ tests/regressiontests/forms/localflavor/ni.py	(revisión: 0)
@@ -0,0 +1,113 @@
+# -*- coding: utf-8 -*-
+# Test for the contrib/localflavor/ NI form fields
+
+tests = """
+#NIPhoneNumberField ########################
+
+A form field that validates Nicaraguan Phone Number validation.
+>>> from django.contrib.localflavor.ni.forms import NIPhoneNumberField
+>>> phone = NIPhoneNumberField()
+>>> phone.clean('98567489')
+u'98567489'                
+>>> phone.clean('9856-7489')
+u'98567489'                 
+>>> phone.clean('98-56-74-89')
+u'98567489'   
+>>> phone.clean('2344 5678')
+u'23445678'
+>>> phone.clean('2344 567 8')
+u'23445678'
+>>> phone.clean('9856-489')
+Traceback (most recent call last):
+  File "<console>", line 1, in <module>
+  File "/usr/lib/python2.5/site-packages/django/contrib/localflavor/ni/forms.py", line 37, in clean
+    raise ValidationError(self.default_error_messages['invalid'])                                  
+ValidationError: [u'Phone numbers must be in the format  XXX-XXXX or XXXXXXX.']                    
+>>> phone.clean('9856K489')                                                                       
+Traceback (most recent call last):                                                                
+  File "<console>", line 1, in <module>
+  File "/usr/lib/python2.5/site-packages/django/contrib/localflavor/ni/forms.py", line 33, in clean
+    v = super(NIPhoneNumberField, self).clean(value)
+  File "/usr/lib/python2.5/site-packages/django/forms/fields.py", line 418, in clean
+    raise ValidationError(self.error_messages['invalid'])
+ValidationError: [u'Phone numbers must be in the format  XXX-XXXX or XXXXXXX.']
+>>> phone.clean('9856*489')
+Traceback (most recent call last):
+  File "<console>", line 1, in <module>
+  File "/usr/lib/python2.5/site-packages/django/contrib/localflavor/ni/forms.py", line 33, in clean
+    v = super(NIPhoneNumberField, self).clean(value)
+  File "/usr/lib/python2.5/site-packages/django/forms/fields.py", line 418, in clean
+    raise ValidationError(self.error_messages['invalid'])
+ValidationError: [u'Phone numbers must be in the format  XXX-XXXX or XXXXXXX.']
+>>> phone.clean('')
+u''
+>>> phone.clean(None)
+u''
+
+
+#NICedulaNumberField ##########
+
+Personal identication number in Nicaragua. In format 999-999999-9999A where 9 is a number an A a letter
+
+>>> from django.contrib.localflavor.ni.forms import NICedulaNumberField
+>>> c = NICedulaNumberField()                                          
+>>> c.clean('001-090934-0002A')
+u'001-090934-0002A'            
+>>> c.clean('001-090934-00023')
+Traceback (most recent call last):
+  File "<stdin>", line 1, in <module>
+  File "/usr/lib/python2.5/site-packages/django/contrib/localflavor/ni/forms.py", line 58, in clean
+    value = super(NICedulaNumberField, self).clean(value)                                          
+  File "/usr/lib/python2.5/site-packages/django/forms/fields.py", line 418, in clean               
+    raise ValidationError(self.error_messages['invalid'])                                          
+django.forms.util.ValidationError>>> c.clean('001-0909A4-0002A')                                 
+Traceback (most recent call last):                                                               
+  File "<stdin>", line 1, in <module>                                                            
+  File "/usr/lib/python2.5/site-packages/django/contrib/localflavor/ni/forms.py", line 58, in clean
+    value = super(NICedulaNumberField, self).clean(value)                                          
+  File "/usr/lib/python2.5/site-packages/django/forms/fields.py", line 418, in clean               
+    raise ValidationError(self.error_messages['invalid'])                                          
+django.forms.util.ValidationError>>> c.clean('001090994-0002A')                                  
+Traceback (most recent call last):
+  File "<stdin>", line 1, in <module>
+  File "/usr/lib/python2.5/site-packages/django/contrib/localflavor/ni/forms.py", line 58, in clean
+    value = super(NICedulaNumberField, self).clean(value)
+  File "/usr/lib/python2.5/site-packages/django/forms/fields.py", line 418, in clean
+    raise ValidationError(self.error_messages['invalid'])
+django.forms.util.ValidationError
+>>> c.clean('0a1-090934-0002A')
+Traceback (most recent call last):
+  File "<stdin>", line 1, in <module>
+  File "/usr/lib/python2.5/site-packages/django/contrib/localflavor/ni/forms.py", line 58, in clean
+    value = super(NICedulaNumberField, self).clean(value)
+  File "/usr/lib/python2.5/site-packages/django/forms/fields.py", line 418, in clean
+    raise ValidationError(self.error_messages['invalid'])
+django.forms.util.ValidationError
+>>> c.clean('001-090994-0002a')
+u'001-090994-0002a'
+
+# NIDepartamentSelect #############
+
+A choice field with the 15 departaments and 2 autonomic regions in Nicaragua.
+>>> from django.contrib.localflavor.ni.forms import NIDepartamentSelect
+>>> d = NIDepartamentSelect()
+>>> print d.render('departaments', 'managua')                                                                                               
+<select name="departaments">                                                                                                                
+<option value="50">Boaco</option>                                                                                                           
+<option value="75">Carazo</option>                                                                                                          
+<option value="30">Chinandega</option>                                                                                                      
+<option value="65">Chontales</option>                                                                                                       
+<option value="25">Estelí</option>
+<option value="70">Granada</option>
+<option value="10">Jinotega</option>
+<option value="35">León</option>
+<option value="20">Madriz</option>
+<option value="55">Managua</option>
+<option value="60">Masaya</option>
+<option value="40">Matagalpa</option>
+<option value="5">Nueva Segovia</option>
+<option value="80">Rivas</option>
+<option value="85">Río San Juan</option>
+<option value="91">Región Autónoma del Atlántico Norte(RAAN)</option>
+<option value="93">Región Autónoma del Atlántico Sur(RAAS)</option>
+</select>
\ No newline at end of file
Index: docs/ref/contrib/localflavor.txt
===================================================================
--- docs/ref/contrib/localflavor.txt	(revisión: 9814)
+++ docs/ref/contrib/localflavor.txt	(copia de trabajo)
@@ -53,6 +53,7 @@
     * Japan_
     * Mexico_
     * `The Netherlands`_
+    * Nicaragua_
     * Norway_
     * Peru_
     * Poland_
@@ -92,6 +93,7 @@
 .. _Italy: `Italy (it)`_
 .. _Japan: `Japan (jp)`_
 .. _Mexico: `Mexico (mx)`_
+.. _Nicaragua: `Nicaragua (ni)`_
 .. _Norway: `Norway (no)`_
 .. _Peru: `Peru (pe)`_
 .. _Poland: `Poland (pl)`_
@@ -390,6 +392,24 @@
 
     A ``Select`` widget that uses a list of Mexican states as its choices.
 
+Nicaragua (``ni``)
+===============
+
+.. class:: ni.forms.NIDepartamentSelect
+
+    A ``ChoiceField`` that uses a displays of Nicaraguan departaments and regions.
+
+.. class:: ni.forms.NICedulaNumberField
+
+    A form field that validates input as a Nicaraguan Cedula number 
+    (nicaraguan oficial identification document).
+
+.. class:: ni.forms.NIPhoneNumberField
+
+    A form field that validates input as a Nicaraguan Telephone number. Seven digits 
+    with or without a hypen.
+
+
 Norway (``no``)
 ===============
 
