Pakistan (pk)

Forms

Pakistani-specific Form helpers

class localflavor.pk.forms.PKPhoneNumberField(max_length=None, min_length=None, *args, **kwargs)[source]

A form field that validates input as an Pakistani phone number.

Valid numbers have nine to eleven digits.

clean(value)[source]

Validate a phone number. Strips parentheses, whitespace and hyphens.

class localflavor.pk.forms.PKPostCodeField(*args, **kwargs)[source]

Pakistani post code field.

Assumed to be 5 digits.

class localflavor.pk.forms.PKStateSelect(attrs=None)[source]

A Select widget that uses a list of Pakistani states/territories as its choices.

Models

class localflavor.pk.models.PKPhoneNumberField(*args, **kwargs)[source]

A model field that checks that the value is a valid Pakistani phone number (nine to eleven digits).

description = <django.utils.functional.__proxy__ object>
formfield(**kwargs)[source]
class localflavor.pk.models.PKPostCodeField(*args, **kwargs)[source]

A model field that forms represent as a PKPostCodeField field and stores the five-digit Pakistani postcode in the database.

description = <django.utils.functional.__proxy__ object>
formfield(**kwargs)[source]
class localflavor.pk.models.PKStateField(*args, **kwargs)[source]

A model field that is represented with STATE_CHOICES` choices and stores the five-letter Pakistani state abbreviation in the database.

description = <django.utils.functional.__proxy__ object>

Data

localflavor.pk.pk_states.STATE_CHOICES = (('PK-JK', <django.utils.functional.__proxy__ object at 0x7f9540b1dcd0>), ('PK-BA', <django.utils.functional.__proxy__ object at 0x7f9540b1dd90>), ('PK-TA', <django.utils.functional.__proxy__ object at 0x7f9540b1de10>), ('PK-GB', <django.utils.functional.__proxy__ object at 0x7f9540b1de90>), ('PK-IS', <django.utils.functional.__proxy__ object at 0x7f9540b1df10>), ('PK-KP', <django.utils.functional.__proxy__ object at 0x7f9540b1df90>), ('PK-PB', <django.utils.functional.__proxy__ object at 0x7f9540b25050>), ('PK-SD', <django.utils.functional.__proxy__ object at 0x7f9540b250d0>))

An alphabetical list of states for use as choices in a formfield.