Fixed #16202 -- Added a Slovenian localflavor. Thanks to Jure Cuhalev < gandalf@owca.info>, Gasper Zejn and Domen Kozar for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16706 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
93fbb77d9b
commit
6757568bfa
|
@ -0,0 +1,164 @@
|
|||
"""
|
||||
Slovenian specific form helpers.
|
||||
"""
|
||||
|
||||
import datetime
|
||||
import re
|
||||
|
||||
from django.forms.fields import CharField, Select, ChoiceField
|
||||
from django.core.validators import EMPTY_VALUES
|
||||
from django.forms import ValidationError
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
class SIEMSOField(CharField):
|
||||
"""A form for validating Slovenian personal identification number.
|
||||
|
||||
Additionally stores gender, nationality and birthday to self.info dictionary.
|
||||
"""
|
||||
|
||||
default_error_messages = {
|
||||
'invalid': _(u'This field should contain exactly 13 digits.'),
|
||||
'date': _(u'The first 7 digits of the EMSO must represent a valid past date.'),
|
||||
'checksum': _(u'The EMSO is not valid.'),
|
||||
}
|
||||
emso_regex = re.compile('^(\d{2})(\d{2})(\d{3})(\d{2})(\d{3})(\d)$')
|
||||
|
||||
def clean(self, value):
|
||||
super(SIEMSOField, self).clean(value)
|
||||
if value in EMPTY_VALUES:
|
||||
return u''
|
||||
|
||||
value = value.strip()
|
||||
|
||||
m = self.emso_regex.match(value)
|
||||
if m is None:
|
||||
raise ValidationError(self.default_error_messages['invalid'])
|
||||
|
||||
# Validate EMSO
|
||||
s = 0
|
||||
int_values = [int(i) for i in value]
|
||||
for a, b in zip(int_values, range(7, 1, -1) * 2):
|
||||
s += a * b
|
||||
chk = s % 11
|
||||
if chk == 0:
|
||||
K = 0
|
||||
else:
|
||||
K = 11 - chk
|
||||
|
||||
if K == 10 or int_values[-1] != K:
|
||||
raise ValidationError(self.default_error_messages['checksum'])
|
||||
|
||||
# Extract extra info in the identification number
|
||||
day, month, year, nationality, gender, chksum = [int(i) for i in m.groups()]
|
||||
|
||||
if year < 890:
|
||||
year += 2000
|
||||
else:
|
||||
year += 1000
|
||||
|
||||
# validate birthday
|
||||
try:
|
||||
birthday = datetime.date(year, month, day)
|
||||
except ValueError:
|
||||
raise ValidationError(self.error_messages['date'])
|
||||
if datetime.date.today() < birthday:
|
||||
raise ValidationError(self.error_messages['date'])
|
||||
|
||||
self.info = {
|
||||
'gender': gender < 500 and 'male' or 'female',
|
||||
'birthdate': birthday,
|
||||
'nationality': nationality,
|
||||
}
|
||||
return value
|
||||
|
||||
|
||||
class SITaxNumberField(CharField):
|
||||
"""Slovenian tax number field.
|
||||
|
||||
Valid input is SIXXXXXXXX or XXXXXXXX where X is a number.
|
||||
"""
|
||||
|
||||
default_error_messages = {
|
||||
'invalid': _(u'Enter a valid tax number in form SIXXXXXXXX'),
|
||||
}
|
||||
sitax_regex = re.compile('^(?:SI)?([1-9]\d{7})$')
|
||||
|
||||
def clean(self, value):
|
||||
super(SITaxNumberField, self).clean(value)
|
||||
if value in EMPTY_VALUES:
|
||||
return u''
|
||||
|
||||
value = value.strip()
|
||||
|
||||
m = self.sitax_regex.match(value)
|
||||
if m is None:
|
||||
raise ValidationError(self.default_error_messages['invalid'])
|
||||
value = m.groups()[0]
|
||||
|
||||
# Validate Tax number
|
||||
s = 0
|
||||
int_values = [int(i) for i in value]
|
||||
for a, b in zip(int_values, range(8, 1, -1)):
|
||||
s += a * b
|
||||
chk = 11 - (s % 11)
|
||||
if chk == 10:
|
||||
chk = 0
|
||||
|
||||
if int_values[-1] != chk:
|
||||
raise ValidationError(self.default_error_messages['invalid'])
|
||||
|
||||
return value
|
||||
|
||||
|
||||
class SIPostalCodeField(ChoiceField):
|
||||
"""Slovenian post codes field.
|
||||
"""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
from si_postalcodes import SI_POSTALCODES_CHOICES
|
||||
kwargs.setdefault('choices', SI_POSTALCODES_CHOICES)
|
||||
super(SIPostalCodeField, self).__init__(*args, **kwargs)
|
||||
|
||||
|
||||
class SIPostalCodeSelect(Select):
|
||||
"""A Select widget that uses Slovenian postal codes as its choices.
|
||||
"""
|
||||
def __init__(self, attrs=None):
|
||||
from si_postalcodes import SI_POSTALCODES_CHOICES
|
||||
super(SIPostalCodeSelect, self).__init__(attrs,
|
||||
choices=SI_POSTALCODES_CHOICES)
|
||||
|
||||
|
||||
class SIPhoneNumberField(CharField):
|
||||
"""Slovenian phone number field.
|
||||
|
||||
Phone number must contain at least local area code.
|
||||
Country code can be present.
|
||||
|
||||
Examples:
|
||||
|
||||
* +38640XXXXXX
|
||||
* 0038640XXXXXX
|
||||
* 040XXXXXX
|
||||
* 01XXXXXX
|
||||
* 0590XXXXX
|
||||
|
||||
"""
|
||||
|
||||
default_error_messages = {
|
||||
'invalid': _(u'Enter phone number in form +386XXXXXXXX or 0XXXXXXXX.'),
|
||||
}
|
||||
phone_regex = re.compile('^(?:(?:00|\+)386|0)(\d{7,8})$')
|
||||
|
||||
def clean(self, value):
|
||||
super(SIPhoneNumberField, self).clean(value)
|
||||
if value in EMPTY_VALUES:
|
||||
return u''
|
||||
|
||||
value = value.replace(' ', '').replace('-', '').replace('/', '')
|
||||
m = self.phone_regex.match(value)
|
||||
|
||||
if m is None:
|
||||
raise ValidationError(self.default_error_messages['invalid'])
|
||||
return m.groups()[0]
|
|
@ -0,0 +1,468 @@
|
|||
# *-* coding: utf-8 *-*
|
||||
|
||||
SI_POSTALCODES = [
|
||||
(1000, u'Ljubljana'),
|
||||
(1215, u'Medvode'),
|
||||
(1216, u'Smlednik'),
|
||||
(1217, u'Vodice'),
|
||||
(1218, u'Komenda'),
|
||||
(1219, u'Laze v Tuhinju'),
|
||||
(1221, u'Motnik'),
|
||||
(1222, u'Trojane'),
|
||||
(1223, u'Blagovica'),
|
||||
(1225, u'Lukovica'),
|
||||
(1230, u'Dom\u017eale'),
|
||||
(1233, u'Dob'),
|
||||
(1234, u'Menge\u0161'),
|
||||
(1235, u'Radomlje'),
|
||||
(1236, u'Trzin'),
|
||||
(1241, u'Kamnik'),
|
||||
(1242, u'Stahovica'),
|
||||
(1251, u'Morav\u010de'),
|
||||
(1252, u'Va\u010de'),
|
||||
(1262, u'Dol pri Ljubljani'),
|
||||
(1270, u'Litija'),
|
||||
(1272, u'Pol\u0161nik'),
|
||||
(1273, u'Dole pri Litiji'),
|
||||
(1274, u'Gabrovka'),
|
||||
(1275, u'\u0160martno pri Litiji'),
|
||||
(1276, u'Primskovo'),
|
||||
(1281, u'Kresnice'),
|
||||
(1282, u'Sava'),
|
||||
(1290, u'Grosuplje'),
|
||||
(1291, u'\u0160kofljica'),
|
||||
(1292, u'Ig'),
|
||||
(1293, u'\u0160marje - Sap'),
|
||||
(1294, u'Vi\u0161nja Gora'),
|
||||
(1295, u'Ivan\u010dna Gorica'),
|
||||
(1296, u'\u0160entvid pri Sti\u010dni'),
|
||||
(1301, u'Krka'),
|
||||
(1303, u'Zagradec'),
|
||||
(1310, u'Ribnica'),
|
||||
(1311, u'Turjak'),
|
||||
(1312, u'Videm - Dobrepolje'),
|
||||
(1313, u'Struge'),
|
||||
(1314, u'Rob'),
|
||||
(1315, u'Velike La\u0161\u010de'),
|
||||
(1316, u'Ortnek'),
|
||||
(1317, u'Sodra\u017eica'),
|
||||
(1318, u'Lo\u0161ki Potok'),
|
||||
(1319, u'Draga'),
|
||||
(1330, u'Ko\u010devje'),
|
||||
(1331, u'Dolenja vas'),
|
||||
(1332, u'Stara Cerkev'),
|
||||
(1336, u'Kostel'),
|
||||
(1337, u'Osilnica'),
|
||||
(1338, u'Ko\u010devska Reka'),
|
||||
(1351, u'Brezovica pri Ljubljani'),
|
||||
(1352, u'Preserje'),
|
||||
(1353, u'Borovnica'),
|
||||
(1354, u'Horjul'),
|
||||
(1355, u'Polhov Gradec'),
|
||||
(1356, u'Dobrova'),
|
||||
(1357, u'Notranje Gorice'),
|
||||
(1358, u'Log pri Brezovici'),
|
||||
(1360, u'Vrhnika'),
|
||||
(1370, u'Logatec'),
|
||||
(1372, u'Hotedr\u0161ica'),
|
||||
(1373, u'Rovte'),
|
||||
(1380, u'Cerknica'),
|
||||
(1381, u'Rakek'),
|
||||
(1382, u'Begunje pri Cerknici'),
|
||||
(1384, u'Grahovo'),
|
||||
(1385, u'Nova vas'),
|
||||
(1386, u'Stari trg pri Lo\u017eu'),
|
||||
(1410, u'Zagorje ob Savi'),
|
||||
(1411, u'Izlake'),
|
||||
(1412, u'Kisovec'),
|
||||
(1413, u'\u010cem\u0161enik'),
|
||||
(1414, u'Podkum'),
|
||||
(1420, u'Trbovlje'),
|
||||
(1423, u'Dobovec'),
|
||||
(1430, u'Hrastnik'),
|
||||
(1431, u'Dol pri Hrastniku'),
|
||||
(1432, u'Zidani Most'),
|
||||
(1433, u'Rade\u010de'),
|
||||
(1434, u'Loka pri Zidanem Mostu'),
|
||||
(2000, u'Maribor'),
|
||||
(2201, u'Zgornja Kungota'),
|
||||
(2204, u'Miklav\u017e na Dravskem polju'),
|
||||
(2205, u'Star\u0161e'),
|
||||
(2206, u'Marjeta na Dravskem polju'),
|
||||
(2208, u'Pohorje'),
|
||||
(2211, u'Pesnica pri Mariboru'),
|
||||
(2212, u'\u0160entilj v Slovenskih goricah'),
|
||||
(2213, u'Zgornja Velka'),
|
||||
(2214, u'Sladki vrh'),
|
||||
(2215, u'Cer\u0161ak'),
|
||||
(2221, u'Jarenina'),
|
||||
(2222, u'Jakobski Dol'),
|
||||
(2223, u'Jurovski Dol'),
|
||||
(2229, u'Male\u010dnik'),
|
||||
(2230, u'Lenart v Slovenskih goricah'),
|
||||
(2231, u'Pernica'),
|
||||
(2232, u'Voli\u010dina'),
|
||||
(2233, u'Sveta Ana v Slovenskih goricah'),
|
||||
(2234, u'Benedikt'),
|
||||
(2235, u'Sveta Trojica v Slovenskih goricah'),
|
||||
(2236, u'Cerkvenjak'),
|
||||
(2241, u'Spodnji Duplek'),
|
||||
(2242, u'Zgornja Korena'),
|
||||
(2250, u'Ptuj'),
|
||||
(2252, u'Dornava'),
|
||||
(2253, u'Destrnik'),
|
||||
(2254, u'Trnovska vas'),
|
||||
(2255, u'Vitomarci'),
|
||||
(2256, u'Jur\u0161inci'),
|
||||
(2257, u'Polen\u0161ak'),
|
||||
(2258, u'Sveti Toma\u017e'),
|
||||
(2259, u'Ivanjkovci'),
|
||||
(2270, u'Ormo\u017e'),
|
||||
(2272, u'Gori\u0161nica'),
|
||||
(2273, u'Podgorci'),
|
||||
(2274, u'Velika Nedelja'),
|
||||
(2275, u'Miklav\u017e pri Ormo\u017eu'),
|
||||
(2276, u'Kog'),
|
||||
(2277, u'Sredi\u0161\u010de ob Dravi'),
|
||||
(2281, u'Markovci'),
|
||||
(2282, u'Cirkulane'),
|
||||
(2283, u'Zavr\u010d'),
|
||||
(2284, u'Videm pri Ptuju'),
|
||||
(2285, u'Zgornji Leskovec'),
|
||||
(2286, u'Podlehnik'),
|
||||
(2287, u'\u017detale'),
|
||||
(2288, u'Hajdina'),
|
||||
(2289, u'Stoperce'),
|
||||
(2310, u'Slovenska Bistrica'),
|
||||
(2311, u'Ho\u010de'),
|
||||
(2312, u'Orehova vas'),
|
||||
(2313, u'Fram'),
|
||||
(2314, u'Zgornja Polskava'),
|
||||
(2315, u'\u0160martno na Pohorju'),
|
||||
(2316, u'Zgornja Lo\u017enica'),
|
||||
(2317, u'Oplotnica'),
|
||||
(2318, u'Laporje'),
|
||||
(2319, u'Polj\u010dane'),
|
||||
(2321, u'Makole'),
|
||||
(2322, u'Maj\u0161perk'),
|
||||
(2323, u'Ptujska Gora'),
|
||||
(2324, u'Lovrenc na Dravskem polju'),
|
||||
(2325, u'Kidri\u010devo'),
|
||||
(2326, u'Cirkovce'),
|
||||
(2327, u'Ra\u010de'),
|
||||
(2331, u'Pragersko'),
|
||||
(2341, u'Limbu\u0161'),
|
||||
(2342, u'Ru\u0161e'),
|
||||
(2343, u'Fala'),
|
||||
(2344, u'Lovrenc na Pohorju'),
|
||||
(2345, u'Bistrica ob Dravi'),
|
||||
(2351, u'Kamnica'),
|
||||
(2352, u'Selnica ob Dravi'),
|
||||
(2353, u'Sv. Duh na Ostrem Vrhu'),
|
||||
(2354, u'Bresternica'),
|
||||
(2360, u'Radlje ob Dravi'),
|
||||
(2361, u'O\u017ebalt'),
|
||||
(2362, u'Kapla'),
|
||||
(2363, u'Podvelka'),
|
||||
(2364, u'Ribnica na Pohorju'),
|
||||
(2365, u'Vuhred'),
|
||||
(2366, u'Muta'),
|
||||
(2367, u'Vuzenica'),
|
||||
(2370, u'Dravograd'),
|
||||
(2371, u'Trbonje'),
|
||||
(2372, u'Libeli\u010de'),
|
||||
(2373, u'\u0160entjan\u017e pri Dravogradu'),
|
||||
(2380, u'Slovenj Gradec'),
|
||||
(2381, u'Podgorje pri Slovenj Gradcu'),
|
||||
(2382, u'Mislinja'),
|
||||
(2383, u'\u0160martno pri Slovenj Gradcu'),
|
||||
(2390, u'Ravne na Koro\u0161kem'),
|
||||
(2391, u'Prevalje'),
|
||||
(2392, u'Me\u017eica'),
|
||||
(2393, u'\u010crna na Koro\u0161kem'),
|
||||
(2394, u'Kotlje'),
|
||||
(3000, u'Celje'),
|
||||
(3201, u'\u0160martno v Ro\u017eni dolini'),
|
||||
(3202, u'Ljube\u010dna'),
|
||||
(3203, u'Nova Cerkev'),
|
||||
(3204, u'Dobrna'),
|
||||
(3205, u'Vitanje'),
|
||||
(3206, u'Stranice'),
|
||||
(3210, u'Slovenske Konjice'),
|
||||
(3211, u'\u0160kofja vas'),
|
||||
(3212, u'Vojnik'),
|
||||
(3213, u'Frankolovo'),
|
||||
(3214, u'Zre\u010de'),
|
||||
(3215, u'Lo\u010de'),
|
||||
(3220, u'\u0160tore'),
|
||||
(3221, u'Teharje'),
|
||||
(3222, u'Dramlje'),
|
||||
(3223, u'Loka pri \u017dusmu'),
|
||||
(3224, u'Dobje pri Planini'),
|
||||
(3225, u'Planina pri Sevnici'),
|
||||
(3230, u'\u0160entjur'),
|
||||
(3231, u'Grobelno'),
|
||||
(3232, u'Ponikva'),
|
||||
(3233, u'Kalobje'),
|
||||
(3240, u'\u0160marje pri Jel\u0161ah'),
|
||||
(3241, u'Podplat'),
|
||||
(3250, u'Roga\u0161ka Slatina'),
|
||||
(3252, u'Rogatec'),
|
||||
(3253, u'Pristava pri Mestinju'),
|
||||
(3254, u'Pod\u010detrtek'),
|
||||
(3255, u'Bu\u010de'),
|
||||
(3256, u'Bistrica ob Sotli'),
|
||||
(3257, u'Podsreda'),
|
||||
(3260, u'Kozje'),
|
||||
(3261, u'Lesi\u010dno'),
|
||||
(3262, u'Prevorje'),
|
||||
(3263, u'Gorica pri Slivnici'),
|
||||
(3264, u'Sveti \u0160tefan'),
|
||||
(3270, u'La\u0161ko'),
|
||||
(3271, u'\u0160entrupert'),
|
||||
(3272, u'Rimske Toplice'),
|
||||
(3273, u'Jurklo\u0161ter'),
|
||||
(3301, u'Petrov\u010de'),
|
||||
(3302, u'Gri\u017ee'),
|
||||
(3303, u'Gomilsko'),
|
||||
(3304, u'Tabor'),
|
||||
(3305, u'Vransko'),
|
||||
(3310, u'\u017dalec'),
|
||||
(3311, u'\u0160empeter v Savinjski dolini'),
|
||||
(3312, u'Prebold'),
|
||||
(3313, u'Polzela'),
|
||||
(3314, u'Braslov\u010de'),
|
||||
(3320, u'Velenje - dostava'),
|
||||
(3322, u'Velenje - po\u0161tni predali'),
|
||||
(3325, u'\u0160o\u0161tanj'),
|
||||
(3326, u'Topol\u0161ica'),
|
||||
(3327, u'\u0160martno ob Paki'),
|
||||
(3330, u'Mozirje'),
|
||||
(3331, u'Nazarje'),
|
||||
(3332, u'Re\u010dica ob Savinji'),
|
||||
(3333, u'Ljubno ob Savinji'),
|
||||
(3334, u'Lu\u010de'),
|
||||
(3335, u'Sol\u010dava'),
|
||||
(3341, u'\u0160martno ob Dreti'),
|
||||
(3342, u'Gornji Grad'),
|
||||
(4000, u'Kranj'),
|
||||
(4201, u'Zgornja Besnica'),
|
||||
(4202, u'Naklo'),
|
||||
(4203, u'Duplje'),
|
||||
(4204, u'Golnik'),
|
||||
(4205, u'Preddvor'),
|
||||
(4206, u'Zgornje Jezersko'),
|
||||
(4207, u'Cerklje na Gorenjskem'),
|
||||
(4208, u'\u0160en\u010dur'),
|
||||
(4209, u'\u017dabnica'),
|
||||
(4210, u'Brnik - aerodrom'),
|
||||
(4211, u'Mav\u010di\u010de'),
|
||||
(4212, u'Visoko'),
|
||||
(4220, u'\u0160kofja Loka'),
|
||||
(4223, u'Poljane nad \u0160kofjo Loko'),
|
||||
(4224, u'Gorenja vas'),
|
||||
(4225, u'Sovodenj'),
|
||||
(4226, u'\u017diri'),
|
||||
(4227, u'Selca'),
|
||||
(4228, u'\u017delezniki'),
|
||||
(4229, u'Sorica'),
|
||||
(4240, u'Radovljica'),
|
||||
(4243, u'Brezje'),
|
||||
(4244, u'Podnart'),
|
||||
(4245, u'Kropa'),
|
||||
(4246, u'Kamna Gorica'),
|
||||
(4247, u'Zgornje Gorje'),
|
||||
(4248, u'Lesce'),
|
||||
(4260, u'Bled'),
|
||||
(4263, u'Bohinjska Bela'),
|
||||
(4264, u'Bohinjska Bistrica'),
|
||||
(4265, u'Bohinjsko jezero'),
|
||||
(4267, u'Srednja vas v Bohinju'),
|
||||
(4270, u'Jesenice'),
|
||||
(4273, u'Blejska Dobrava'),
|
||||
(4274, u'\u017dirovnica'),
|
||||
(4275, u'Begunje na Gorenjskem'),
|
||||
(4276, u'Hru\u0161ica'),
|
||||
(4280, u'Kranjska Gora'),
|
||||
(4281, u'Mojstrana'),
|
||||
(4282, u'Gozd Martuljek'),
|
||||
(4283, u'Rate\u010de - Planica'),
|
||||
(4290, u'Tr\u017ei\u010d'),
|
||||
(4294, u'Kri\u017ee'),
|
||||
(5000, u'Nova Gorica'),
|
||||
(5210, u'Deskle'),
|
||||
(5211, u'Kojsko'),
|
||||
(5212, u'Dobrovo v Brdih'),
|
||||
(5213, u'Kanal'),
|
||||
(5214, u'Kal nad Kanalom'),
|
||||
(5215, u'Ro\u010dinj'),
|
||||
(5216, u'Most na So\u010di'),
|
||||
(5220, u'Tolmin'),
|
||||
(5222, u'Kobarid'),
|
||||
(5223, u'Breginj'),
|
||||
(5224, u'Srpenica'),
|
||||
(5230, u'Bovec'),
|
||||
(5231, u'Log pod Mangartom'),
|
||||
(5232, u'So\u010da'),
|
||||
(5242, u'Grahovo ob Ba\u010di'),
|
||||
(5243, u'Podbrdo'),
|
||||
(5250, u'Solkan'),
|
||||
(5251, u'Grgar'),
|
||||
(5252, u'Trnovo pri Gorici'),
|
||||
(5253, u'\u010cepovan'),
|
||||
(5261, u'\u0160empas'),
|
||||
(5262, u'\u010crni\u010de'),
|
||||
(5263, u'Dobravlje'),
|
||||
(5270, u'Ajdov\u0161\u010dina'),
|
||||
(5271, u'Vipava'),
|
||||
(5272, u'Podnanos'),
|
||||
(5273, u'Col'),
|
||||
(5274, u'\u010crni Vrh nad Idrijo'),
|
||||
(5275, u'Godovi\u010d'),
|
||||
(5280, u'Idrija'),
|
||||
(5281, u'Spodnja Idrija'),
|
||||
(5282, u'Cerkno'),
|
||||
(5283, u'Slap ob Idrijci'),
|
||||
(5290, u'\u0160empeter pri Gorici'),
|
||||
(5291, u'Miren'),
|
||||
(5292, u'Ren\u010de'),
|
||||
(5293, u'Vol\u010dja Draga'),
|
||||
(5294, u'Dornberk'),
|
||||
(5295, u'Branik'),
|
||||
(5296, u'Kostanjevica na Krasu'),
|
||||
(5297, u'Prva\u010dina'),
|
||||
(6000, u'Koper'),
|
||||
(6210, u'Se\u017eana'),
|
||||
(6215, u'Diva\u010da'),
|
||||
(6216, u'Podgorje'),
|
||||
(6217, u'Vremski Britof'),
|
||||
(6219, u'Lokev'),
|
||||
(6221, u'Dutovlje'),
|
||||
(6222, u'\u0160tanjel'),
|
||||
(6223, u'Komen'),
|
||||
(6224, u'Seno\u017ee\u010de'),
|
||||
(6225, u'Hru\u0161evje'),
|
||||
(6230, u'Postojna'),
|
||||
(6232, u'Planina'),
|
||||
(6240, u'Kozina'),
|
||||
(6242, u'Materija'),
|
||||
(6243, u'Obrov'),
|
||||
(6244, u'Podgrad'),
|
||||
(6250, u'Ilirska Bistrica'),
|
||||
(6251, u'Ilirska Bistrica - Trnovo'),
|
||||
(6253, u'Kne\u017eak'),
|
||||
(6254, u'Jel\u0161ane'),
|
||||
(6255, u'Prem'),
|
||||
(6256, u'Ko\u0161ana'),
|
||||
(6257, u'Pivka'),
|
||||
(6258, u'Prestranek'),
|
||||
(6271, u'Dekani'),
|
||||
(6272, u'Gra\u010di\u0161\u010de'),
|
||||
(6273, u'Marezige'),
|
||||
(6274, u'\u0160marje'),
|
||||
(6275, u'\u010crni Kal'),
|
||||
(6276, u'Pobegi'),
|
||||
(6280, u'Ankaran - Ancarano'),
|
||||
(6281, u'\u0160kofije'),
|
||||
(6310, u'Izola - Isola'),
|
||||
(6320, u'Portoro\u017e - Portorose'),
|
||||
(6330, u'Piran - Pirano'),
|
||||
(6333, u'Se\u010dovlje - Sicciole'),
|
||||
(8000, u'Novo mesto'),
|
||||
(8210, u'Trebnje'),
|
||||
(8211, u'Dobrni\u010d'),
|
||||
(8212, u'Velika Loka'),
|
||||
(8213, u'Veliki Gaber'),
|
||||
(8216, u'Mirna Pe\u010d'),
|
||||
(8220, u'\u0160marje\u0161ke Toplice'),
|
||||
(8222, u'Oto\u010dec'),
|
||||
(8230, u'Mokronog'),
|
||||
(8231, u'Trebelno'),
|
||||
(8232, u'\u0160entrupert'),
|
||||
(8233, u'Mirna'),
|
||||
(8250, u'Bre\u017eice'),
|
||||
(8251, u'\u010cate\u017e ob Savi'),
|
||||
(8253, u'Arti\u010de'),
|
||||
(8254, u'Globoko'),
|
||||
(8255, u'Pi\u0161ece'),
|
||||
(8256, u'Sromlje'),
|
||||
(8257, u'Dobova'),
|
||||
(8258, u'Kapele'),
|
||||
(8259, u'Bizeljsko'),
|
||||
(8261, u'Jesenice na Dolenjskem'),
|
||||
(8262, u'Kr\u0161ka vas'),
|
||||
(8263, u'Cerklje ob Krki'),
|
||||
(8270, u'Kr\u0161ko'),
|
||||
(8272, u'Zdole'),
|
||||
(8273, u'Leskovec pri Kr\u0161kem'),
|
||||
(8274, u'Raka'),
|
||||
(8275, u'\u0160kocjan'),
|
||||
(8276, u'Bu\u010dka'),
|
||||
(8280, u'Brestanica'),
|
||||
(8281, u'Senovo'),
|
||||
(8282, u'Koprivnica'),
|
||||
(8283, u'Blanca'),
|
||||
(8290, u'Sevnica'),
|
||||
(8292, u'Zabukovje'),
|
||||
(8293, u'Studenec'),
|
||||
(8294, u'Bo\u0161tanj'),
|
||||
(8295, u'Tr\u017ei\u0161\u010de'),
|
||||
(8296, u'Krmelj'),
|
||||
(8297, u'\u0160entjan\u017e'),
|
||||
(8310, u'\u0160entjernej'),
|
||||
(8311, u'Kostanjevica na Krki'),
|
||||
(8312, u'Podbo\u010dje'),
|
||||
(8321, u'Brusnice'),
|
||||
(8322, u'Stopi\u010de'),
|
||||
(8323, u'Ur\u0161na sela'),
|
||||
(8330, u'Metlika'),
|
||||
(8331, u'Suhor'),
|
||||
(8332, u'Gradac'),
|
||||
(8333, u'Semi\u010d'),
|
||||
(8340, u'\u010crnomelj'),
|
||||
(8341, u'Adle\u0161i\u010di'),
|
||||
(8342, u'Stari trg ob Kolpi'),
|
||||
(8343, u'Dragatu\u0161'),
|
||||
(8344, u'Vinica pri \u010crnomlju'),
|
||||
(8350, u'Dolenjske Toplice'),
|
||||
(8351, u'Stra\u017ea'),
|
||||
(8360, u'\u017du\u017eemberk'),
|
||||
(8361, u'Dvor'),
|
||||
(8362, u'Hinje'),
|
||||
(9000, u'Murska Sobota'),
|
||||
(9201, u'Puconci'),
|
||||
(9202, u'Ma\u010dkovci'),
|
||||
(9203, u'Petrovci'),
|
||||
(9204, u'\u0160alovci'),
|
||||
(9205, u'Hodo\u0161 - Hodos'),
|
||||
(9206, u'Kri\u017eevci'),
|
||||
(9207, u'Prosenjakovci - Partosfalva'),
|
||||
(9208, u'Fokovci'),
|
||||
(9220, u'Lendava - Lendva'),
|
||||
(9221, u'Martjanci'),
|
||||
(9222, u'Bogojina'),
|
||||
(9223, u'Dobrovnik - Dobronak'),
|
||||
(9224, u'Turni\u0161\u010de'),
|
||||
(9225, u'Velika Polana'),
|
||||
(9226, u'Moravske Toplice'),
|
||||
(9227, u'Kobilje'),
|
||||
(9231, u'Beltinci'),
|
||||
(9232, u'\u010cren\u0161ovci'),
|
||||
(9233, u'Odranci'),
|
||||
(9240, u'Ljutomer'),
|
||||
(9241, u'Ver\u017eej'),
|
||||
(9242, u'Kri\u017eevci pri Ljutomeru'),
|
||||
(9243, u'Mala Nedelja'),
|
||||
(9244, u'Sveti Jurij ob \u0160\u010davnici'),
|
||||
(9245, u'Spodnji Ivanjci'),
|
||||
(9250, u'Gornja Radgona'),
|
||||
(9251, u'Ti\u0161ina'),
|
||||
(9252, u'Radenci'),
|
||||
(9253, u'Apa\u010de'),
|
||||
(9261, u'Cankova'),
|
||||
(9262, u'Roga\u0161ovci'),
|
||||
(9263, u'Kuzma'),
|
||||
(9264, u'Grad'),
|
||||
(9265, u'Bodonci')]
|
||||
|
||||
SI_POSTALCODES_CHOICES = sorted(SI_POSTALCODES, key=lambda k: k[1])
|
|
@ -70,6 +70,7 @@ Countries currently supported by :mod:`~django.contrib.localflavor` are:
|
|||
* Romania_
|
||||
* Russia_
|
||||
* Slovakia_
|
||||
* Slovenia_
|
||||
* `South Africa`_
|
||||
* Spain_
|
||||
* Sweden_
|
||||
|
@ -126,6 +127,7 @@ Here's an example of how to use them::
|
|||
.. _Romania: `Romania (ro)`_
|
||||
.. _Russia: `Russia (ru)`_
|
||||
.. _Slovakia: `Slovakia (sk)`_
|
||||
.. _Slovenia: `Slovenia (si)`_
|
||||
.. _South Africa: `South Africa (za)`_
|
||||
.. _Spain: `Spain (es)`_
|
||||
.. _Sweden: `Sweden (se)`_
|
||||
|
@ -1068,6 +1070,35 @@ Slovakia (``sk``)
|
|||
|
||||
A ``Select`` widget that uses a list of Slovak regions as its choices.
|
||||
|
||||
Slovenia (``si``)
|
||||
=================
|
||||
|
||||
.. class:: si.forms.SIEMSOField
|
||||
|
||||
A form field that validates input as Slovenian personal identification
|
||||
number and stores gender and birthday to self.info dictionary.
|
||||
|
||||
.. class:: si.forms.SITaxNumberField
|
||||
|
||||
A form field that validates input as a Slovenian tax number. Valid input
|
||||
is SIXXXXXXXX or XXXXXXXX.
|
||||
|
||||
.. class:: si.forms.SIPhoneNumberField
|
||||
|
||||
A form field that validates input as a Slovenian phone number. Phone
|
||||
number must contain at least local area code with optional country code.
|
||||
|
||||
.. class:: si.forms.SIPostalCodeField
|
||||
|
||||
A form field that provides a choice field of major Slovenian postal
|
||||
codes.
|
||||
|
||||
.. class:: si.forms.SIPostalCodeSelect
|
||||
|
||||
A ``Select`` widget that uses a list of major Slovenian postal codes as
|
||||
its choices.
|
||||
|
||||
|
||||
South Africa (``za``)
|
||||
=====================
|
||||
|
||||
|
|
|
@ -0,0 +1,556 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from datetime import date
|
||||
|
||||
from django.contrib.localflavor.si.forms import (SIEMSOField, SITaxNumberField,
|
||||
SIPhoneNumberField, SIPostalCodeField, SIPostalCodeSelect)
|
||||
from django.test import SimpleTestCase
|
||||
|
||||
|
||||
class SILocalFlavorTests(SimpleTestCase):
|
||||
def test_SITaxNumberField(self):
|
||||
error_invalid = [u'Enter a valid tax number in form SIXXXXXXXX']
|
||||
valid = {
|
||||
'15012557': '15012557',
|
||||
'SI15012557': '15012557',
|
||||
'22111310': '22111310',
|
||||
}
|
||||
invalid = {
|
||||
'22241310': error_invalid,
|
||||
'15012558': error_invalid,
|
||||
'1501': error_invalid,
|
||||
'1501123123123': error_invalid,
|
||||
'abcdabcd': error_invalid,
|
||||
'01234579': error_invalid,
|
||||
}
|
||||
self.assertFieldOutput(SITaxNumberField, valid, invalid)
|
||||
|
||||
def test_SIEMSOField(self):
|
||||
error_invalid = [u'This field should contain exactly 13 digits.']
|
||||
error_invalid_date = [u'The first 7 digits of the EMSO must represent a valid past date.']
|
||||
error_invalid_chksum = [u'The EMSO is not valid.']
|
||||
valid = {
|
||||
'0205951500462': '0205951500462',
|
||||
'2309002500068': '2309002500068',
|
||||
'1010985500400': '1010985500400',
|
||||
}
|
||||
invalid = {
|
||||
'0205951500463': error_invalid_chksum,
|
||||
'020': error_invalid,
|
||||
'020020595150046020595150046': error_invalid,
|
||||
'aaaabbbbccccd': error_invalid,
|
||||
'1010985500800': error_invalid_chksum,
|
||||
'2020095500070': error_invalid_date,
|
||||
'5050095500078': error_invalid_date,
|
||||
'1010889500408': error_invalid_date,
|
||||
}
|
||||
self.assertFieldOutput(SIEMSOField, valid, invalid)
|
||||
|
||||
def test_SIEMSOField_info_dict(self):
|
||||
valid = {
|
||||
'0205951500462': {'nationality': 50, 'gender': 'male', 'birthdate': date(1951, 5, 2)},
|
||||
'2309002504063': {'nationality': 50, 'gender': 'male', 'birthdate': date(2002, 9, 23)},
|
||||
'1010985505402': {'nationality': 50, 'gender': 'female', 'birthdate': date(1985, 10, 10)},
|
||||
}
|
||||
for input, info in valid.items():
|
||||
f = SIEMSOField()
|
||||
f.clean(input)
|
||||
self.assertEqual(f.info, info)
|
||||
|
||||
def test_SIPhoneNumberField(self):
|
||||
error_invalid = [u'Enter phone number in form +386XXXXXXXX or 0XXXXXXXX.']
|
||||
valid = {
|
||||
'+38640999999': '40999999',
|
||||
'+3861999999': '1999999',
|
||||
'0038640999999': '40999999',
|
||||
'040999999': '40999999',
|
||||
'01999999': '1999999',
|
||||
'059099999': '59099999',
|
||||
'059 09 99 99': '59099999',
|
||||
'0590/999-99': '59099999',
|
||||
}
|
||||
invalid = {
|
||||
'03861999999': error_invalid,
|
||||
'3861999999': error_invalid,
|
||||
}
|
||||
self.assertFieldOutput(SIPhoneNumberField, valid, invalid)
|
||||
|
||||
def test_SIPostalCodeField(self):
|
||||
valid = {
|
||||
'4000': '4000',
|
||||
'1000': '1000'
|
||||
}
|
||||
invalid = {
|
||||
'1113': [u'Select a valid choice. 1113 is not one of the available choices.'],
|
||||
'111': [u'Select a valid choice. 111 is not one of the available choices.'],
|
||||
}
|
||||
self.assertFieldOutput(SIPostalCodeField, valid, invalid)
|
||||
|
||||
def test_SIPostalCodeSelect(self):
|
||||
f = SIPostalCodeSelect()
|
||||
out = u'''<select name="Kranj">
|
||||
<option value="8341">Adle\u0161i\u010di</option>
|
||||
<option value="5270">Ajdov\u0161\u010dina</option>
|
||||
<option value="6280">Ankaran - Ancarano</option>
|
||||
<option value="9253">Apa\u010de</option>
|
||||
<option value="8253">Arti\u010de</option>
|
||||
<option value="4275">Begunje na Gorenjskem</option>
|
||||
<option value="1382">Begunje pri Cerknici</option>
|
||||
<option value="9231">Beltinci</option>
|
||||
<option value="2234">Benedikt</option>
|
||||
<option value="2345">Bistrica ob Dravi</option>
|
||||
<option value="3256">Bistrica ob Sotli</option>
|
||||
<option value="8259">Bizeljsko</option>
|
||||
<option value="1223">Blagovica</option>
|
||||
<option value="8283">Blanca</option>
|
||||
<option value="4260">Bled</option>
|
||||
<option value="4273">Blejska Dobrava</option>
|
||||
<option value="9265">Bodonci</option>
|
||||
<option value="9222">Bogojina</option>
|
||||
<option value="4263">Bohinjska Bela</option>
|
||||
<option value="4264">Bohinjska Bistrica</option>
|
||||
<option value="4265">Bohinjsko jezero</option>
|
||||
<option value="1353">Borovnica</option>
|
||||
<option value="5230">Bovec</option>
|
||||
<option value="8294">Bo\u0161tanj</option>
|
||||
<option value="5295">Branik</option>
|
||||
<option value="3314">Braslov\u010de</option>
|
||||
<option value="5223">Breginj</option>
|
||||
<option value="8280">Brestanica</option>
|
||||
<option value="2354">Bresternica</option>
|
||||
<option value="4243">Brezje</option>
|
||||
<option value="1351">Brezovica pri Ljubljani</option>
|
||||
<option value="8250">Bre\u017eice</option>
|
||||
<option value="4210">Brnik - aerodrom</option>
|
||||
<option value="8321">Brusnice</option>
|
||||
<option value="3255">Bu\u010de</option>
|
||||
<option value="8276">Bu\u010dka</option>
|
||||
<option value="9261">Cankova</option>
|
||||
<option value="3000">Celje</option>
|
||||
<option value="4207">Cerklje na Gorenjskem</option>
|
||||
<option value="8263">Cerklje ob Krki</option>
|
||||
<option value="1380">Cerknica</option>
|
||||
<option value="5282">Cerkno</option>
|
||||
<option value="2236">Cerkvenjak</option>
|
||||
<option value="2215">Cer\u0161ak</option>
|
||||
<option value="2326">Cirkovce</option>
|
||||
<option value="2282">Cirkulane</option>
|
||||
<option value="5273">Col</option>
|
||||
<option value="6271">Dekani</option>
|
||||
<option value="5210">Deskle</option>
|
||||
<option value="2253">Destrnik</option>
|
||||
<option value="6215">Diva\u010da</option>
|
||||
<option value="1233">Dob</option>
|
||||
<option value="3224">Dobje pri Planini</option>
|
||||
<option value="8257">Dobova</option>
|
||||
<option value="1423">Dobovec</option>
|
||||
<option value="5263">Dobravlje</option>
|
||||
<option value="3204">Dobrna</option>
|
||||
<option value="8211">Dobrni\u010d</option>
|
||||
<option value="1356">Dobrova</option>
|
||||
<option value="9223">Dobrovnik - Dobronak</option>
|
||||
<option value="5212">Dobrovo v Brdih</option>
|
||||
<option value="1431">Dol pri Hrastniku</option>
|
||||
<option value="1262">Dol pri Ljubljani</option>
|
||||
<option value="1273">Dole pri Litiji</option>
|
||||
<option value="1331">Dolenja vas</option>
|
||||
<option value="8350">Dolenjske Toplice</option>
|
||||
<option value="1230">Dom\u017eale</option>
|
||||
<option value="2252">Dornava</option>
|
||||
<option value="5294">Dornberk</option>
|
||||
<option value="1319">Draga</option>
|
||||
<option value="8343">Dragatu\u0161</option>
|
||||
<option value="3222">Dramlje</option>
|
||||
<option value="2370">Dravograd</option>
|
||||
<option value="4203">Duplje</option>
|
||||
<option value="6221">Dutovlje</option>
|
||||
<option value="8361">Dvor</option>
|
||||
<option value="2343">Fala</option>
|
||||
<option value="9208">Fokovci</option>
|
||||
<option value="2313">Fram</option>
|
||||
<option value="3213">Frankolovo</option>
|
||||
<option value="1274">Gabrovka</option>
|
||||
<option value="8254">Globoko</option>
|
||||
<option value="5275">Godovi\u010d</option>
|
||||
<option value="4204">Golnik</option>
|
||||
<option value="3303">Gomilsko</option>
|
||||
<option value="4224">Gorenja vas</option>
|
||||
<option value="3263">Gorica pri Slivnici</option>
|
||||
<option value="2272">Gori\u0161nica</option>
|
||||
<option value="9250">Gornja Radgona</option>
|
||||
<option value="3342">Gornji Grad</option>
|
||||
<option value="4282">Gozd Martuljek</option>
|
||||
<option value="9264">Grad</option>
|
||||
<option value="8332">Gradac</option>
|
||||
<option value="1384">Grahovo</option>
|
||||
<option value="5242">Grahovo ob Ba\u010di</option>
|
||||
<option value="6272">Gra\u010di\u0161\u010de</option>
|
||||
<option value="5251">Grgar</option>
|
||||
<option value="3302">Gri\u017ee</option>
|
||||
<option value="3231">Grobelno</option>
|
||||
<option value="1290">Grosuplje</option>
|
||||
<option value="2288">Hajdina</option>
|
||||
<option value="8362">Hinje</option>
|
||||
<option value="9205">Hodo\u0161 - Hodos</option>
|
||||
<option value="1354">Horjul</option>
|
||||
<option value="1372">Hotedr\u0161ica</option>
|
||||
<option value="2311">Ho\u010de</option>
|
||||
<option value="1430">Hrastnik</option>
|
||||
<option value="6225">Hru\u0161evje</option>
|
||||
<option value="4276">Hru\u0161ica</option>
|
||||
<option value="5280">Idrija</option>
|
||||
<option value="1292">Ig</option>
|
||||
<option value="6250">Ilirska Bistrica</option>
|
||||
<option value="6251">Ilirska Bistrica - Trnovo</option>
|
||||
<option value="2259">Ivanjkovci</option>
|
||||
<option value="1295">Ivan\u010dna Gorica</option>
|
||||
<option value="1411">Izlake</option>
|
||||
<option value="6310">Izola - Isola</option>
|
||||
<option value="2222">Jakobski Dol</option>
|
||||
<option value="2221">Jarenina</option>
|
||||
<option value="6254">Jel\u0161ane</option>
|
||||
<option value="4270">Jesenice</option>
|
||||
<option value="8261">Jesenice na Dolenjskem</option>
|
||||
<option value="3273">Jurklo\u0161ter</option>
|
||||
<option value="2223">Jurovski Dol</option>
|
||||
<option value="2256">Jur\u0161inci</option>
|
||||
<option value="5214">Kal nad Kanalom</option>
|
||||
<option value="3233">Kalobje</option>
|
||||
<option value="4246">Kamna Gorica</option>
|
||||
<option value="2351">Kamnica</option>
|
||||
<option value="1241">Kamnik</option>
|
||||
<option value="5213">Kanal</option>
|
||||
<option value="8258">Kapele</option>
|
||||
<option value="2362">Kapla</option>
|
||||
<option value="2325">Kidri\u010devo</option>
|
||||
<option value="1412">Kisovec</option>
|
||||
<option value="6253">Kne\u017eak</option>
|
||||
<option value="5222">Kobarid</option>
|
||||
<option value="9227">Kobilje</option>
|
||||
<option value="2276">Kog</option>
|
||||
<option value="5211">Kojsko</option>
|
||||
<option value="6223">Komen</option>
|
||||
<option value="1218">Komenda</option>
|
||||
<option value="6000">Koper</option>
|
||||
<option value="8282">Koprivnica</option>
|
||||
<option value="5296">Kostanjevica na Krasu</option>
|
||||
<option value="8311">Kostanjevica na Krki</option>
|
||||
<option value="1336">Kostel</option>
|
||||
<option value="2394">Kotlje</option>
|
||||
<option value="6240">Kozina</option>
|
||||
<option value="3260">Kozje</option>
|
||||
<option value="1330">Ko\u010devje</option>
|
||||
<option value="1338">Ko\u010devska Reka</option>
|
||||
<option value="6256">Ko\u0161ana</option>
|
||||
<option value="4000" selected="selected">Kranj</option>
|
||||
<option value="4280">Kranjska Gora</option>
|
||||
<option value="1281">Kresnice</option>
|
||||
<option value="4294">Kri\u017ee</option>
|
||||
<option value="9206">Kri\u017eevci</option>
|
||||
<option value="9242">Kri\u017eevci pri Ljutomeru</option>
|
||||
<option value="1301">Krka</option>
|
||||
<option value="8296">Krmelj</option>
|
||||
<option value="4245">Kropa</option>
|
||||
<option value="8262">Kr\u0161ka vas</option>
|
||||
<option value="8270">Kr\u0161ko</option>
|
||||
<option value="9263">Kuzma</option>
|
||||
<option value="2318">Laporje</option>
|
||||
<option value="1219">Laze v Tuhinju</option>
|
||||
<option value="3270">La\u0161ko</option>
|
||||
<option value="2230">Lenart v Slovenskih goricah</option>
|
||||
<option value="9220">Lendava - Lendva</option>
|
||||
<option value="4248">Lesce</option>
|
||||
<option value="3261">Lesi\u010dno</option>
|
||||
<option value="8273">Leskovec pri Kr\u0161kem</option>
|
||||
<option value="2372">Libeli\u010de</option>
|
||||
<option value="2341">Limbu\u0161</option>
|
||||
<option value="1270">Litija</option>
|
||||
<option value="3202">Ljube\u010dna</option>
|
||||
<option value="1000">Ljubljana</option>
|
||||
<option value="3333">Ljubno ob Savinji</option>
|
||||
<option value="9240">Ljutomer</option>
|
||||
<option value="5231">Log pod Mangartom</option>
|
||||
<option value="1358">Log pri Brezovici</option>
|
||||
<option value="1370">Logatec</option>
|
||||
<option value="1434">Loka pri Zidanem Mostu</option>
|
||||
<option value="3223">Loka pri \u017dusmu</option>
|
||||
<option value="6219">Lokev</option>
|
||||
<option value="2324">Lovrenc na Dravskem polju</option>
|
||||
<option value="2344">Lovrenc na Pohorju</option>
|
||||
<option value="3215">Lo\u010de</option>
|
||||
<option value="1318">Lo\u0161ki Potok</option>
|
||||
<option value="1225">Lukovica</option>
|
||||
<option value="3334">Lu\u010de</option>
|
||||
<option value="2322">Maj\u0161perk</option>
|
||||
<option value="2321">Makole</option>
|
||||
<option value="9243">Mala Nedelja</option>
|
||||
<option value="2229">Male\u010dnik</option>
|
||||
<option value="6273">Marezige</option>
|
||||
<option value="2000">Maribor</option>
|
||||
<option value="2206">Marjeta na Dravskem polju</option>
|
||||
<option value="2281">Markovci</option>
|
||||
<option value="9221">Martjanci</option>
|
||||
<option value="6242">Materija</option>
|
||||
<option value="4211">Mav\u010di\u010de</option>
|
||||
<option value="9202">Ma\u010dkovci</option>
|
||||
<option value="1215">Medvode</option>
|
||||
<option value="1234">Menge\u0161</option>
|
||||
<option value="8330">Metlika</option>
|
||||
<option value="2392">Me\u017eica</option>
|
||||
<option value="2204">Miklav\u017e na Dravskem polju</option>
|
||||
<option value="2275">Miklav\u017e pri Ormo\u017eu</option>
|
||||
<option value="5291">Miren</option>
|
||||
<option value="8233">Mirna</option>
|
||||
<option value="8216">Mirna Pe\u010d</option>
|
||||
<option value="2382">Mislinja</option>
|
||||
<option value="4281">Mojstrana</option>
|
||||
<option value="8230">Mokronog</option>
|
||||
<option value="9226">Moravske Toplice</option>
|
||||
<option value="1251">Morav\u010de</option>
|
||||
<option value="5216">Most na So\u010di</option>
|
||||
<option value="1221">Motnik</option>
|
||||
<option value="3330">Mozirje</option>
|
||||
<option value="9000">Murska Sobota</option>
|
||||
<option value="2366">Muta</option>
|
||||
<option value="4202">Naklo</option>
|
||||
<option value="3331">Nazarje</option>
|
||||
<option value="1357">Notranje Gorice</option>
|
||||
<option value="3203">Nova Cerkev</option>
|
||||
<option value="5000">Nova Gorica</option>
|
||||
<option value="1385">Nova vas</option>
|
||||
<option value="8000">Novo mesto</option>
|
||||
<option value="6243">Obrov</option>
|
||||
<option value="9233">Odranci</option>
|
||||
<option value="2317">Oplotnica</option>
|
||||
<option value="2312">Orehova vas</option>
|
||||
<option value="2270">Ormo\u017e</option>
|
||||
<option value="1316">Ortnek</option>
|
||||
<option value="1337">Osilnica</option>
|
||||
<option value="8222">Oto\u010dec</option>
|
||||
<option value="2361">O\u017ebalt</option>
|
||||
<option value="2231">Pernica</option>
|
||||
<option value="2211">Pesnica pri Mariboru</option>
|
||||
<option value="9203">Petrovci</option>
|
||||
<option value="3301">Petrov\u010de</option>
|
||||
<option value="6330">Piran - Pirano</option>
|
||||
<option value="6257">Pivka</option>
|
||||
<option value="8255">Pi\u0161ece</option>
|
||||
<option value="6232">Planina</option>
|
||||
<option value="3225">Planina pri Sevnici</option>
|
||||
<option value="6276">Pobegi</option>
|
||||
<option value="8312">Podbo\u010dje</option>
|
||||
<option value="5243">Podbrdo</option>
|
||||
<option value="2273">Podgorci</option>
|
||||
<option value="6216">Podgorje</option>
|
||||
<option value="2381">Podgorje pri Slovenj Gradcu</option>
|
||||
<option value="6244">Podgrad</option>
|
||||
<option value="1414">Podkum</option>
|
||||
<option value="2286">Podlehnik</option>
|
||||
<option value="5272">Podnanos</option>
|
||||
<option value="4244">Podnart</option>
|
||||
<option value="3241">Podplat</option>
|
||||
<option value="3257">Podsreda</option>
|
||||
<option value="2363">Podvelka</option>
|
||||
<option value="3254">Pod\u010detrtek</option>
|
||||
<option value="2208">Pohorje</option>
|
||||
<option value="2257">Polen\u0161ak</option>
|
||||
<option value="1355">Polhov Gradec</option>
|
||||
<option value="4223">Poljane nad \u0160kofjo Loko</option>
|
||||
<option value="2319">Polj\u010dane</option>
|
||||
<option value="3313">Polzela</option>
|
||||
<option value="1272">Pol\u0161nik</option>
|
||||
<option value="3232">Ponikva</option>
|
||||
<option value="6320">Portoro\u017e - Portorose</option>
|
||||
<option value="6230">Postojna</option>
|
||||
<option value="2331">Pragersko</option>
|
||||
<option value="3312">Prebold</option>
|
||||
<option value="4205">Preddvor</option>
|
||||
<option value="6255">Prem</option>
|
||||
<option value="1352">Preserje</option>
|
||||
<option value="6258">Prestranek</option>
|
||||
<option value="2391">Prevalje</option>
|
||||
<option value="3262">Prevorje</option>
|
||||
<option value="1276">Primskovo</option>
|
||||
<option value="3253">Pristava pri Mestinju</option>
|
||||
<option value="9207">Prosenjakovci - Partosfalva</option>
|
||||
<option value="5297">Prva\u010dina</option>
|
||||
<option value="2250">Ptuj</option>
|
||||
<option value="2323">Ptujska Gora</option>
|
||||
<option value="9201">Puconci</option>
|
||||
<option value="9252">Radenci</option>
|
||||
<option value="1433">Rade\u010de</option>
|
||||
<option value="2360">Radlje ob Dravi</option>
|
||||
<option value="1235">Radomlje</option>
|
||||
<option value="4240">Radovljica</option>
|
||||
<option value="8274">Raka</option>
|
||||
<option value="1381">Rakek</option>
|
||||
<option value="4283">Rate\u010de - Planica</option>
|
||||
<option value="2390">Ravne na Koro\u0161kem</option>
|
||||
<option value="2327">Ra\u010de</option>
|
||||
<option value="5292">Ren\u010de</option>
|
||||
<option value="3332">Re\u010dica ob Savinji</option>
|
||||
<option value="1310">Ribnica</option>
|
||||
<option value="2364">Ribnica na Pohorju</option>
|
||||
<option value="3272">Rimske Toplice</option>
|
||||
<option value="1314">Rob</option>
|
||||
<option value="3252">Rogatec</option>
|
||||
<option value="3250">Roga\u0161ka Slatina</option>
|
||||
<option value="9262">Roga\u0161ovci</option>
|
||||
<option value="1373">Rovte</option>
|
||||
<option value="5215">Ro\u010dinj</option>
|
||||
<option value="2342">Ru\u0161e</option>
|
||||
<option value="1282">Sava</option>
|
||||
<option value="4227">Selca</option>
|
||||
<option value="2352">Selnica ob Dravi</option>
|
||||
<option value="8333">Semi\u010d</option>
|
||||
<option value="8281">Senovo</option>
|
||||
<option value="6224">Seno\u017ee\u010de</option>
|
||||
<option value="8290">Sevnica</option>
|
||||
<option value="6333">Se\u010dovlje - Sicciole</option>
|
||||
<option value="6210">Se\u017eana</option>
|
||||
<option value="2214">Sladki vrh</option>
|
||||
<option value="5283">Slap ob Idrijci</option>
|
||||
<option value="2380">Slovenj Gradec</option>
|
||||
<option value="2310">Slovenska Bistrica</option>
|
||||
<option value="3210">Slovenske Konjice</option>
|
||||
<option value="1216">Smlednik</option>
|
||||
<option value="1317">Sodra\u017eica</option>
|
||||
<option value="5250">Solkan</option>
|
||||
<option value="3335">Sol\u010dava</option>
|
||||
<option value="4229">Sorica</option>
|
||||
<option value="4225">Sovodenj</option>
|
||||
<option value="5232">So\u010da</option>
|
||||
<option value="5281">Spodnja Idrija</option>
|
||||
<option value="2241">Spodnji Duplek</option>
|
||||
<option value="9245">Spodnji Ivanjci</option>
|
||||
<option value="2277">Sredi\u0161\u010de ob Dravi</option>
|
||||
<option value="4267">Srednja vas v Bohinju</option>
|
||||
<option value="8256">Sromlje</option>
|
||||
<option value="5224">Srpenica</option>
|
||||
<option value="1242">Stahovica</option>
|
||||
<option value="1332">Stara Cerkev</option>
|
||||
<option value="8342">Stari trg ob Kolpi</option>
|
||||
<option value="1386">Stari trg pri Lo\u017eu</option>
|
||||
<option value="2205">Star\u0161e</option>
|
||||
<option value="2289">Stoperce</option>
|
||||
<option value="8322">Stopi\u010de</option>
|
||||
<option value="3206">Stranice</option>
|
||||
<option value="8351">Stra\u017ea</option>
|
||||
<option value="1313">Struge</option>
|
||||
<option value="8293">Studenec</option>
|
||||
<option value="8331">Suhor</option>
|
||||
<option value="2353">Sv. Duh na Ostrem Vrhu</option>
|
||||
<option value="2233">Sveta Ana v Slovenskih goricah</option>
|
||||
<option value="2235">Sveta Trojica v Slovenskih goricah</option>
|
||||
<option value="9244">Sveti Jurij ob \u0160\u010davnici</option>
|
||||
<option value="2258">Sveti Toma\u017e</option>
|
||||
<option value="3264">Sveti \u0160tefan</option>
|
||||
<option value="3304">Tabor</option>
|
||||
<option value="3221">Teharje</option>
|
||||
<option value="9251">Ti\u0161ina</option>
|
||||
<option value="5220">Tolmin</option>
|
||||
<option value="3326">Topol\u0161ica</option>
|
||||
<option value="2371">Trbonje</option>
|
||||
<option value="1420">Trbovlje</option>
|
||||
<option value="8231">Trebelno</option>
|
||||
<option value="8210">Trebnje</option>
|
||||
<option value="5252">Trnovo pri Gorici</option>
|
||||
<option value="2254">Trnovska vas</option>
|
||||
<option value="1222">Trojane</option>
|
||||
<option value="1236">Trzin</option>
|
||||
<option value="4290">Tr\u017ei\u010d</option>
|
||||
<option value="8295">Tr\u017ei\u0161\u010de</option>
|
||||
<option value="1311">Turjak</option>
|
||||
<option value="9224">Turni\u0161\u010de</option>
|
||||
<option value="8323">Ur\u0161na sela</option>
|
||||
<option value="1252">Va\u010de</option>
|
||||
<option value="3320">Velenje - dostava</option>
|
||||
<option value="3322">Velenje - po\u0161tni predali</option>
|
||||
<option value="8212">Velika Loka</option>
|
||||
<option value="2274">Velika Nedelja</option>
|
||||
<option value="9225">Velika Polana</option>
|
||||
<option value="1315">Velike La\u0161\u010de</option>
|
||||
<option value="8213">Veliki Gaber</option>
|
||||
<option value="9241">Ver\u017eej</option>
|
||||
<option value="1312">Videm - Dobrepolje</option>
|
||||
<option value="2284">Videm pri Ptuju</option>
|
||||
<option value="8344">Vinica pri \u010crnomlju</option>
|
||||
<option value="5271">Vipava</option>
|
||||
<option value="4212">Visoko</option>
|
||||
<option value="3205">Vitanje</option>
|
||||
<option value="2255">Vitomarci</option>
|
||||
<option value="1294">Vi\u0161nja Gora</option>
|
||||
<option value="1217">Vodice</option>
|
||||
<option value="3212">Vojnik</option>
|
||||
<option value="2232">Voli\u010dina</option>
|
||||
<option value="5293">Vol\u010dja Draga</option>
|
||||
<option value="3305">Vransko</option>
|
||||
<option value="6217">Vremski Britof</option>
|
||||
<option value="1360">Vrhnika</option>
|
||||
<option value="2365">Vuhred</option>
|
||||
<option value="2367">Vuzenica</option>
|
||||
<option value="8292">Zabukovje</option>
|
||||
<option value="1410">Zagorje ob Savi</option>
|
||||
<option value="1303">Zagradec</option>
|
||||
<option value="2283">Zavr\u010d</option>
|
||||
<option value="8272">Zdole</option>
|
||||
<option value="4201">Zgornja Besnica</option>
|
||||
<option value="2242">Zgornja Korena</option>
|
||||
<option value="2201">Zgornja Kungota</option>
|
||||
<option value="2316">Zgornja Lo\u017enica</option>
|
||||
<option value="2314">Zgornja Polskava</option>
|
||||
<option value="2213">Zgornja Velka</option>
|
||||
<option value="4247">Zgornje Gorje</option>
|
||||
<option value="4206">Zgornje Jezersko</option>
|
||||
<option value="2285">Zgornji Leskovec</option>
|
||||
<option value="1432">Zidani Most</option>
|
||||
<option value="3214">Zre\u010de</option>
|
||||
<option value="8251">\u010cate\u017e ob Savi</option>
|
||||
<option value="1413">\u010cem\u0161enik</option>
|
||||
<option value="5253">\u010cepovan</option>
|
||||
<option value="9232">\u010cren\u0161ovci</option>
|
||||
<option value="2393">\u010crna na Koro\u0161kem</option>
|
||||
<option value="6275">\u010crni Kal</option>
|
||||
<option value="5274">\u010crni Vrh nad Idrijo</option>
|
||||
<option value="5262">\u010crni\u010de</option>
|
||||
<option value="8340">\u010crnomelj</option>
|
||||
<option value="9204">\u0160alovci</option>
|
||||
<option value="5261">\u0160empas</option>
|
||||
<option value="5290">\u0160empeter pri Gorici</option>
|
||||
<option value="3311">\u0160empeter v Savinjski dolini</option>
|
||||
<option value="2212">\u0160entilj v Slovenskih goricah</option>
|
||||
<option value="8297">\u0160entjan\u017e</option>
|
||||
<option value="2373">\u0160entjan\u017e pri Dravogradu</option>
|
||||
<option value="8310">\u0160entjernej</option>
|
||||
<option value="3230">\u0160entjur</option>
|
||||
<option value="3271">\u0160entrupert</option>
|
||||
<option value="8232">\u0160entrupert</option>
|
||||
<option value="1296">\u0160entvid pri Sti\u010dni</option>
|
||||
<option value="4208">\u0160en\u010dur</option>
|
||||
<option value="8275">\u0160kocjan</option>
|
||||
<option value="6281">\u0160kofije</option>
|
||||
<option value="4220">\u0160kofja Loka</option>
|
||||
<option value="3211">\u0160kofja vas</option>
|
||||
<option value="1291">\u0160kofljica</option>
|
||||
<option value="6274">\u0160marje</option>
|
||||
<option value="1293">\u0160marje - Sap</option>
|
||||
<option value="3240">\u0160marje pri Jel\u0161ah</option>
|
||||
<option value="8220">\u0160marje\u0161ke Toplice</option>
|
||||
<option value="2315">\u0160martno na Pohorju</option>
|
||||
<option value="3341">\u0160martno ob Dreti</option>
|
||||
<option value="3327">\u0160martno ob Paki</option>
|
||||
<option value="1275">\u0160martno pri Litiji</option>
|
||||
<option value="2383">\u0160martno pri Slovenj Gradcu</option>
|
||||
<option value="3201">\u0160martno v Ro\u017eni dolini</option>
|
||||
<option value="3325">\u0160o\u0161tanj</option>
|
||||
<option value="6222">\u0160tanjel</option>
|
||||
<option value="3220">\u0160tore</option>
|
||||
<option value="4209">\u017dabnica</option>
|
||||
<option value="3310">\u017dalec</option>
|
||||
<option value="4228">\u017delezniki</option>
|
||||
<option value="2287">\u017detale</option>
|
||||
<option value="4226">\u017diri</option>
|
||||
<option value="4274">\u017dirovnica</option>
|
||||
<option value="8360">\u017du\u017eemberk</option>
|
||||
</select>'''
|
||||
self.assertEqual(f.render('Kranj', '4000'), out)
|
|
@ -34,6 +34,7 @@ from py.tests import *
|
|||
from ro.tests import *
|
||||
from ru.tests import *
|
||||
from se.tests import *
|
||||
from si.tests import *
|
||||
from sk.tests import *
|
||||
from tr.tests import *
|
||||
from us.tests import *
|
||||
|
|
Loading…
Reference in New Issue