Macedonia (mk)

Forms

class localflavor.mk.forms.MKIdentityCardNumberField(**kwargs)[source]

A Macedonian ID card number.

Accepts both old and new format.

class localflavor.mk.forms.MKMunicipalitySelect(attrs=None)[source]

A form Select widget that uses a list of Macedonian municipalities as choices.

The label is the name of the municipality and the value is a 2 character code for the municipality.

class localflavor.mk.forms.UMCNField(**kwargs)[source]

A form field that validates input as a unique master citizen number.

The format of the unique master citizen number has been kept the same from Yugoslavia. It is still in use in other countries as well, it is not applicable solely in Macedonia. For more information see: https://secure.wikimedia.org/wikipedia/en/wiki/Unique_Master_Citizen_Number

A value will pass validation if it complies to the following rules:

  • Consists of exactly 13 digits
  • The first 7 digits represent a valid past date in the format DDMMYYY
  • The last digit of the UMCN passes a checksum test
clean(value)[source]

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

Models

class localflavor.mk.models.MKIdentityCardNumberField(*args, **kwargs)[source]

A form field that validates input as a Macedonian identity card number.

Both old and new identity card numbers are supported.

formfield(**kwargs)[source]

Return a django.forms.Field instance for this field.

class localflavor.mk.models.MKMunicipalityField(*args, **kwargs)[source]

A form field that validates input as a Macedonian identity card number.

Both old and new identity card numbers are supported.

deconstruct()[source]

Return enough information to recreate the field as a 4-tuple:

  • The name of the field on the model, if contribute_to_class() has been run.
  • The import path of the field, including the class:e.g. django.db.models.IntegerField This should be the most portable version, so less specific may be better.
  • A list of positional arguments.
  • A dict of keyword arguments.

Note that the positional or keyword arguments must contain values of the following types (including inner values of collection types):

  • None, bool, str, int, float, complex, set, frozenset, list, tuple, dict
  • UUID
  • datetime.datetime (naive), datetime.date
  • top-level classes, top-level functions - will be referenced by their full import path
  • Storage instances - these have their own deconstruct() method

This is because the values here must be serialized into a text format (possibly new Python code, possibly JSON) and these are the only types with encoding handlers defined.

There’s no need to return the exact way the field was instantiated this time, just ensure that the resulting field is the same - prefer keyword arguments over positional ones, and omit parameters with their default values.

class localflavor.mk.models.UMCNField(*args, **kwargs)[source]

A form field that validates input as a unique master citizen number.

The format of the unique master citizen number is not unique to Macedonia. For more information see: https://secure.wikimedia.org/wikipedia/en/wiki/Unique_Master_Citizen_Number

A value will pass validation if it complies to the following rules:

  • Consists of exactly 13 digits
  • The first 7 digits represent a valid past date in the format DDMMYYY
  • The last digit of the UMCN passes a checksum test
formfield(**kwargs)[source]

Return a django.forms.Field instance for this field.

Data

localflavor.mk.mk_choices.MK_MUNICIPALITIES = (('AD', 'Aerodrom'), ('AR', 'Aračinovo'), ('BR', 'Berovo'), ('TL', 'Bitola'), ('BG', 'Bogdanci'), ('VJ', 'Bogovinje'), ('BS', 'Bosilovo'), ('BN', 'Brvenica'), ('BU', 'Butel'), ('VA', 'Valandovo'), ('VL', 'Vasilevo'), ('VV', 'Vevčani'), ('VE', 'Veles'), ('NI', 'Vinica'), ('VC', 'Vraneštica'), ('VH', 'Vrapčište'), ('GB', 'Gazi Baba'), ('GV', 'Gevgelija'), ('GT', 'Gostivar'), ('GR', 'Gradsko'), ('DB', 'Debar'), ('DA', 'Debarca'), ('DL', 'Delčevo'), ('DK', 'Demir Kapija'), ('DM', 'Demir Hisar'), ('DE', 'Dolneni'), ('DR', 'Drugovo'), ('GP', 'Gjorče Petrov'), ('ZE', 'Želino'), ('ZA', 'Zajas'), ('ZK', 'Zelenikovo'), ('ZR', 'Zrnovci'), ('IL', 'Ilinden'), ('JG', 'Jegunovce'), ('AV', 'Kavadarci'), ('KB', 'Karbinci'), ('KX', 'Karpoš'), ('VD', 'Kisela Voda'), ('KH', 'Kičevo'), ('KN', 'Konče'), ('OC', 'Koćani'), ('KY', 'Kratovo'), ('KZ', 'Kriva Palanka'), ('KG', 'Krivogaštani'), ('KS', 'Kruševo'), ('UM', 'Kumanovo'), ('LI', 'Lipkovo'), ('LO', 'Lozovo'), ('MR', 'Mavrovo i Rostuša'), ('MK', 'Makedonska Kamenica'), ('MD', 'Makedonski Brod'), ('MG', 'Mogila'), ('NG', 'Negotino'), ('NV', 'Novaci'), ('NS', 'Novo Selo'), ('OS', 'Oslomej'), ('OD', 'Ohrid'), ('PE', 'Petrovec'), ('PH', 'Pehčevo'), ('PN', 'Plasnica'), ('PP', 'Prilep'), ('PT', 'Probištip'), ('RV', 'Radoviš'), ('RN', 'Rankovce'), ('RE', 'Resen'), ('RO', 'Rosoman'), ('AJ', 'Saraj'), ('SL', 'Sveti Nikole'), ('SS', 'Sopište'), ('SD', 'Star Dojran'), ('NA', 'Staro Nagoričane'), ('UG', 'Struga'), ('RU', 'Strumica'), ('SU', 'Studeničani'), ('TR', 'Tearce'), ('ET', 'Tetovo'), ('CE', 'Centar'), ('CZ', 'Centar-Župa'), ('CI', 'Čair'), ('CA', 'Čaška'), ('CH', 'Češinovo-Obleševo'), ('CS', 'Čučer-Sandevo'), ('ST', 'Štip'), ('SO', 'Šuto Orizari'))

Macedonian municipalities per the reorganization from 2004.