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=u'', 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=u'', 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=u'', 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).
Data¶
-
localflavor.pt.pt_regions.
REGION_CHOICES
= ((u'01', <django.utils.functional.__proxy__ object at 0x7f953e0fea10>), (u'02', <django.utils.functional.__proxy__ object at 0x7f953e0fea90>), (u'03', <django.utils.functional.__proxy__ object at 0x7f953e0feb10>), (u'04', <django.utils.functional.__proxy__ object at 0x7f953e0feb90>), (u'05', <django.utils.functional.__proxy__ object at 0x7f953e0fec10>), (u'06', <django.utils.functional.__proxy__ object at 0x7f953e0fec90>), (u'07', <django.utils.functional.__proxy__ object at 0x7f953e0fed10>), (u'08', <django.utils.functional.__proxy__ object at 0x7f953e0fed90>), (u'09', <django.utils.functional.__proxy__ object at 0x7f953e0fee10>), (u'10', <django.utils.functional.__proxy__ object at 0x7f953e0fee90>), (u'11', <django.utils.functional.__proxy__ object at 0x7f953e0fef10>), (u'12', <django.utils.functional.__proxy__ object at 0x7f953e0fef90>), (u'13', <django.utils.functional.__proxy__ object at 0x7f953e0c8050>), (u'14', <django.utils.functional.__proxy__ object at 0x7f953e0c80d0>), (u'15', <django.utils.functional.__proxy__ object at 0x7f953e0c8150>), (u'16', <django.utils.functional.__proxy__ object at 0x7f953e0c81d0>), (u'17', <django.utils.functional.__proxy__ object at 0x7f953e0c8250>), (u'18', <django.utils.functional.__proxy__ object at 0x7f953e0c82d0>), (u'20', <django.utils.functional.__proxy__ object at 0x7f953e0c8350>), (u'30', <django.utils.functional.__proxy__ object at 0x7f953e0c83d0>))¶ A tuple representing Portuguese regions (as per ISO3166:2-PT).