Portugal (pt)

Forms

django_localflavot_pt.forms

Contains PT-specific Django form helpers.

class localflavor.pt.forms.PTCitizenCardNumberField(required=True, widget=None, label=None, initial=None, help_text=None, error_messages=None, show_hidden_initial=False, validators=[], localize=False)[source]

A field which validates Portuguese Citizen Card numbers (locally CC - ‘Cartão do Cidadão’).

  • Citizen Card numbers have the format XXXXXXXXXYYX or XXXXXXXX-XYYX (where X is a digit and Y is an alphanumeric character).
  • Citizen Card numbers validate as per http://bit.ly/RP0BzW.
  • The input string may or may not have an hyphen separating the identity number from the document’s check-digits.
  • This field does NOT validate old ID card numbers (locally BI - ‘Bilhete de Identidade’).
class localflavor.pt.forms.PTPhoneNumberField(required=True, widget=None, label=None, initial=None, help_text=None, error_messages=None, show_hidden_initial=False, validators=[], localize=False)[source]

A field which validates Portuguese phone numbers.

  • Phone numbers have at least 3 and at most 9 digits and may optionally be prefixed with ‘00351’ or ‘+351’.
  • The input string is allowed to contain spaces (though they will be stripped).
class localflavor.pt.forms.PTRegionSelect(attrs=None)[source]

A select widget which uses a list of Portuguese regions as its choices.

  • Regions correspond to the Portuguese ‘distritos’ and ‘regiões autónomas’ as per ISO3166:2-PT.
class localflavor.pt.forms.PTSocialSecurityNumberField(required=True, widget=None, label=None, initial=None, help_text=None, error_messages=None, show_hidden_initial=False, validators=[], localize=False)[source]

A field which validates Portuguese Social Security numbers (locally NISS - ‘Número de Identificação na Segurança Social’).

  • Social Security numbers must be in the format XYYYYYYYYYY (where X is either 1 or 2 and Y is any other digit).
class localflavor.pt.forms.PTZipCodeField(max_length=None, min_length=None, *args, **kwargs)[source]

A field which validates Portuguese zip codes.

NOTE - Zip codes have the format XYYY-YYY (where X is a digit between 1 and 9 and Y is any other digit).

Data

localflavor.pt.pt_regions.REGION_CHOICES = (('01', 'Aveiro'), ('02', 'Beja'), ('03', 'Braga'), ('04', 'Bragança'), ('05', 'Castelo Branco'), ('06', 'Coimbra'), ('07', 'Évora'), ('08', 'Faro'), ('09', 'Guarda'), ('10', 'Leiria'), ('11', 'Lisboa'), ('12', 'Portalegre'), ('13', 'Porto'), ('14', 'Santarém'), ('15', 'Setúbal'), ('16', 'Viana do Castelo'), ('17', 'Vila Real'), ('18', 'Viseu'), ('20', 'Região Autónoma da Madeira'), ('30', 'Região Autónoma dos Açores'))

A tuple representing Portuguese regions (as per ISO3166:2-PT).

Table Of Contents

Previous topic

Poland (pl)

Next topic

Paraguay (py)

This Page