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: https://ro.wikipedia.org/wiki/Cod_de_Identificare_Fiscal%C4%83

clean(value)[source]

CIF validation

Args:
value: the CIF code
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: https://ro.wikipedia.org/wiki/Cod_numeric_personal

clean(value)[source]

CNP validations

Args:
value: the CNP code
class localflavor.ro.forms.ROCountyField(required=True, widget=None, label=None, initial=None, help_text='', error_messages=None, show_hidden_initial=False, validators=[], localize=False, disabled=False, label_suffix=None)[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 (using comma bellow for ș and ț); consider using ROCountySelect if this behavior is unacceptable for you

For more information regarding diacritics see Comma-below (ș and ț) versus cedilla (ş and ţ) and Unicode and HTML sections from: Romanian alphabet.

Example:
Argeș => valid (comma bellow)
Argeş => invalid (cedilla)
Arges => invalid (no diacritic)
class localflavor.ro.forms.ROCountySelect(attrs=None)[source]

A Select widget that uses a list of Romanian counties (județe) 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.

Args:
value: the phone number
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 = (('AB', 'Alba'), ('AR', 'Arad'), ('AG', 'Argeș'), ('BC', 'Bacău'), ('BH', 'Bihor'), ('BN', 'Bistrița-Năsăud'), ('BT', 'Botoșani'), ('BV', 'Brașov'), ('BR', 'Brăila'), ('B', 'București'), ('BZ', 'Buzău'), ('CS', 'Caraș-Severin'), ('CL', 'Călărași'), ('CJ', 'Cluj'), ('CT', 'Constanța'), ('CV', 'Covasna'), ('DB', 'Dâmbovița'), ('DJ', 'Dolj'), ('GL', 'Galați'), ('GR', 'Giurgiu'), ('GJ', 'Gorj'), ('HR', 'Harghita'), ('HD', 'Hunedoara'), ('IL', 'Ialomița'), ('IS', 'Iași'), ('IF', 'Ilfov'), ('MM', 'Maramureș'), ('MH', 'Mehedinți'), ('MS', 'Mureș'), ('NT', 'Neamț'), ('OT', 'Olt'), ('PH', 'Prahova'), ('SM', 'Satu Mare'), ('SJ', 'Sălaj'), ('SB', 'Sibiu'), ('SV', 'Suceava'), ('TR', 'Teleorman'), ('TM', 'Timiș'), ('TL', 'Tulcea'), ('VS', 'Vaslui'), ('VL', 'Vâlcea'), ('VN', 'Vrancea'))

A list of Romanian counties as choices in a formfield.