Romania (ro)

Forms

Romanian specific form helpers.

class localflavor.ro.forms.ROCIFField(max_length=10, min_length=2, *args, **kwargs)[source]

A Romanian fiscal identity code (CIF) field

For CIF validation algorithm see http://www.validari.ro/cui.html

clean(value)[source]

CIF validation

class localflavor.ro.forms.ROCNPField(max_length=13, min_length=13, *args, **kwargs)[source]

A Romanian personal identity code (CNP) field

For CNP validation algorithm see http://www.validari.ro/cnp.html

clean(value)[source]

CNP validations

class localflavor.ro.forms.ROCountyField(required=True, widget=None, label=None, initial=None, help_text=u'', error_messages=None, show_hidden_initial=False, validators=[], localize=False)[source]

A form field that validates its input is a Romanian county name or abbreviation. It normalizes the input to the standard vehicle registration abbreviation for the given county

WARNING: This field will only accept names written with diacritics; consider using ROCountySelect if this behavior is unnaceptable for you

Example:

Argeş => valid Arges => invalid
class localflavor.ro.forms.ROCountySelect(attrs=None)[source]

A Select widget that uses a list of Romanian counties (judete) as its choices.

class localflavor.ro.forms.ROIBANField(*args, **kwargs)[source]

Romanian International Bank Account Number (IBAN) field

Changed in version 1.1: Validation error messages changed to the messages used in IBANFormField

Deprecated since version 1.1: Use IBANFormField with included_countries=(‘RO’,) option instead.

class localflavor.ro.forms.ROPhoneNumberField(max_length=20, min_length=3, *args, **kwargs)[source]

Romanian phone number field

Changed in version 1.1: Made the field also accept national short phone numbers and 7-digit regional phone numbers besides the regular ones. Official documentation (in English): http://www.ancom.org.ro/en/pnn_1300 Official documentation (in Romanian): http://www.ancom.org.ro/pnn_1300

clean(value)[source]

Strips braces, dashes, dots and spaces. Checks the final length.

class localflavor.ro.forms.ROPostalCodeField(max_length=6, min_length=6, *args, **kwargs)[source]

Romanian postal code field.

Data

localflavor.ro.ro_counties.COUNTIES_CHOICES = ((u'AB', u'Alba'), (u'AR', u'Arad'), (u'AG', u'Arge\u015f'), (u'BC', u'Bac\u0103u'), (u'BH', u'Bihor'), (u'BN', u'Bistri\u0163a-N\u0103s\u0103ud'), (u'BT', u'Boto\u015fani'), (u'BV', u'Bra\u015fov'), (u'BR', u'Br\u0103ila'), (u'B', u'Bucure\u015fti'), (u'BZ', u'Buz\u0103u'), (u'CS', u'Cara\u015f-Severin'), (u'CL', u'C\u0103l\u0103ra\u015fi'), (u'CJ', u'Cluj'), (u'CT', u'Constan\u0163a'), (u'CV', u'Covasna'), (u'DB', u'D\xe2mbovi\u0163a'), (u'DJ', u'Dolj'), (u'GL', u'Gala\u0163i'), (u'GR', u'Giurgiu'), (u'GJ', u'Gorj'), (u'HR', u'Harghita'), (u'HD', u'Hunedoara'), (u'IL', u'Ialomi\u0163a'), (u'IS', u'Ia\u015fi'), (u'IF', u'Ilfov'), (u'MM', u'Maramure\u015f'), (u'MH', u'Mehedin\u0163i'), (u'MS', u'Mure\u015f'), (u'NT', u'Neam\u0163'), (u'OT', u'Olt'), (u'PH', u'Prahova'), (u'SM', u'Satu Mare'), (u'SJ', u'S\u0103laj'), (u'SB', u'Sibiu'), (u'SV', u'Suceava'), (u'TR', u'Teleorman'), (u'TM', u'Timi\u015f'), (u'TL', u'Tulcea'), (u'VS', u'Vaslui'), (u'VL', u'V\xe2lcea'), (u'VN', u'Vrancea'))

A list of Romanian counties as choices in a formfield.