Kuwait (kw)

Forms

Kuwait-specific Form helpers.

class localflavor.kw.forms.KWAreaSelect(attrs=None)[source]

A Select widget that uses a list of Kuwait areas as its choices.

Added in version 1.6.

class localflavor.kw.forms.KWCivilIDNumberField(max_length=12, min_length=12, **kwargs)[source]

Kuwaiti Civil ID numbers are 12 digits, second to seventh digits represents the person’s birthdate.

Checks the following rules to determine the validity of the number:
  • The number consist of 12 digits.

  • The first(century) digit should be 1, 2, or 3.

  • The birthdate of the person is a valid date.

  • The calculated checksum equals to the last digit of the Civil ID.

clean(value)[source]

Validate the given value and return its “cleaned” value as an appropriate Python object. Raise ValidationError for any errors.

class localflavor.kw.forms.KWGovernorateSelect(attrs=None)[source]

A Select widget that uses a list of Kuwait governorates as its choices.

localflavor.kw.forms.is_valid_kw_civilid_checksum(value)[source]

Deprecated since version 5.0: Use localflavor.kw.utils.is_valid_civil_id() instead.