Australia (au)

Forms

Australian-specific Form helpers

class localflavor.au.forms.AUBusinessNumberField(max_length=None, min_length=None, strip=True, *args, **kwargs)[source]

A form field that validates input as an Australian Business Number (ABN)

New in version 1.3.

prepare_value(value)[source]

Format the value for display.

class localflavor.au.forms.AUPhoneNumberField(max_length=None, min_length=None, strip=True, *args, **kwargs)[source]

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

Valid numbers have ten digits.

clean(value)[source]

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

class localflavor.au.forms.AUPostCodeField(max_length=4, min_length=None, *args, **kwargs)[source]

Australian post code field.

Assumed to be 4 digits. Northern Territory 3-digit postcodes should have leading zero.

class localflavor.au.forms.AUStateSelect(attrs=None)[source]

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

class localflavor.au.forms.AUTaxFileNumberField(max_length=None, min_length=None, strip=True, *args, **kwargs)[source]

A form field that validates input as an Australian Tax File Number (TFN)

New in version 1.4.

prepare_value(value)[source]

Format the value for display.

Models

class localflavor.au.models.AUBusinessNumberField(*args, **kwargs)[source]

A model field that checks that the value is a valid Australian Business Number (ABN).

New in version 1.3.

deconstruct()[source]
description = 'Australian Business Number'
formfield(**kwargs)[source]
to_python(value)[source]

Ensure the ABN is stored without spaces.

validators = [<localflavor.au.validators.AUBusinessNumberFieldValidator object at 0x7f93457ad080>, <django.core.validators.MaxLengthValidator object at 0x7f93457ad630>]
class localflavor.au.models.AUPhoneNumberField(*args, **kwargs)[source]

A model field that checks that the value is a valid Australian phone number (ten digits).

deconstruct()[source]
description = 'Australian Phone number'
formfield(**kwargs)[source]
class localflavor.au.models.AUPostCodeField(*args, **kwargs)[source]

A model field that forms represent as a AUPostCodeField field and stores the four-digit Australian postcode in the database.

deconstruct()[source]
description = 'Australian Postcode'
formfield(**kwargs)[source]
class localflavor.au.models.AUStateField(*args, **kwargs)[source]

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

deconstruct()[source]
description = 'Australian State'
class localflavor.au.models.AUTaxFileNumberField(*args, **kwargs)[source]

A model field that checks that the value is a valid Tax File Number (TFN).

A TFN is a number issued to a person by the Commissioner of Taxation and is used to verify client identity and establish their income levels. It is a eight or nine digit number without any embedded meaning.

New in version 1.4.

deconstruct()[source]
description = 'Australian Tax File Number'
formfield(**kwargs)[source]
to_python(value)[source]

Ensure the TFN is stored without spaces.

validators = [<localflavor.au.validators.AUTaxFileNumberFieldValidator object at 0x7f93457ad278>, <django.core.validators.MaxLengthValidator object at 0x7f93457ad6d8>]

Data

localflavor.au.au_states.STATE_CHOICES = (('ACT', 'Australian Capital Territory'), ('NSW', 'New South Wales'), ('NT', 'Northern Territory'), ('QLD', 'Queensland'), ('SA', 'South Australia'), ('TAS', 'Tasmania'), ('VIC', 'Victoria'), ('WA', 'Western Australia'))

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