diff --git a/AUTHORS b/AUTHORS
index 7bbec38..558f0ff 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -297,6 +297,7 @@ answer newbie questions, and generally made Django that much better:
     Carlos Eduardo de Paula <carlosedp@gmail.com>
     pavithran s <pavithran.s@gmail.com>
     Barry Pederson <bp@barryp.org>
+    Andreas Pelme <andreas@pelme.se>
     permonik@mesias.brnonet.cz
     peter@mymart.com
     pgross@thoughtworks.com
diff --git a/django/conf/locale/sv/LC_MESSAGES/django.mo b/django/conf/locale/sv/LC_MESSAGES/django.mo
index f2ae006..ea2dc58 100644
Binary files a/django/conf/locale/sv/LC_MESSAGES/django.mo and b/django/conf/locale/sv/LC_MESSAGES/django.mo differ
diff --git a/django/conf/locale/sv/LC_MESSAGES/django.po b/django/conf/locale/sv/LC_MESSAGES/django.po
index d279647..5a75119 100644
--- a/django/conf/locale/sv/LC_MESSAGES/django.po
+++ b/django/conf/locale/sv/LC_MESSAGES/django.po
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Django\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-09-03 04:36+0200\n"
+"POT-Creation-Date: 2008-10-03 11:01-0500\n"
 "PO-Revision-Date: 2008-05-26 11:15+0200\n"
 "Last-Translator: Ludvig Ericson <ludvig.ericson@gmail.com>\n"
 "Language-Team: Django I18N <Django-I18N@googlegroups.com>\n"
@@ -347,30 +347,30 @@ msgid ""
 msgstr ""
 "%(name)s \"%(obj)s\" lades till. Du kan redigera objektet igen nedanför."
 
-#: contrib/admin/options.py:536
+#: contrib/admin/options.py:528
 #, python-format
 msgid "Add %s"
 msgstr "Lägg till %s"
 
-#: contrib/admin/options.py:614
+#: contrib/admin/options.py:605
 #, python-format
 msgid "Change %s"
 msgstr "Ändra %s"
 
-#: contrib/admin/options.py:646
+#: contrib/admin/options.py:637
 msgid "Database error"
 msgstr "Databasfel"
 
-#: contrib/admin/options.py:696
+#: contrib/admin/options.py:687
 #, python-format
 msgid "The %(name)s \"%(obj)s\" was deleted successfully."
 msgstr "%(name)s \"%(obj)s\" togs bort."
 
-#: contrib/admin/options.py:703
+#: contrib/admin/options.py:694
 msgid "Are you sure?"
 msgstr "Är du säker?"
 
-#: contrib/admin/options.py:732
+#: contrib/admin/options.py:723
 #, python-format
 msgid "Change history: %s"
 msgstr "Ändringshistorik: %s"
@@ -384,11 +384,11 @@ msgstr ""
 "Var god ange ett korrekt användarnamn och lösenord. Tänk på att skilja "
 "mellan gemener och versaler."
 
-#: contrib/admin/sites.py:227 contrib/admin/views/decorators.py:40
+#: contrib/admin/sites.py:226 contrib/admin/views/decorators.py:40
 msgid "Please log in again, because your session has expired."
 msgstr "Var god logga in igen, eftersom din session har förfallit."
 
-#: contrib/admin/sites.py:234 contrib/admin/views/decorators.py:47
+#: contrib/admin/sites.py:233 contrib/admin/views/decorators.py:47
 msgid ""
 "Looks like your browser isn't configured to accept cookies. Please enable "
 "cookies, reload this page, and try again."
@@ -396,27 +396,27 @@ msgstr ""
 "Det verkar som att din webläsare inte är konfigurerad att acceptera cookies. "
 "Aktivera cookies, ladda om denna sida och försök igen."
 
-#: contrib/admin/sites.py:250 contrib/admin/sites.py:256
+#: contrib/admin/sites.py:249 contrib/admin/sites.py:255
 #: contrib/admin/views/decorators.py:66
 msgid "Usernames cannot contain the '@' character."
 msgstr "Användarnamn får inte innehålla '@'-tecknet."
 
-#: contrib/admin/sites.py:253 contrib/admin/views/decorators.py:62
+#: contrib/admin/sites.py:252 contrib/admin/views/decorators.py:62
 #, python-format
 msgid "Your e-mail address is not your username. Try '%s' instead."
 msgstr "Din e-postadress är inte ditt användarnamn. Försök med '%s' istället."
 
-#: contrib/admin/sites.py:313
+#: contrib/admin/sites.py:312
 msgid "Site administration"
 msgstr "Webbplatsadministration"
 
-#: contrib/admin/sites.py:326 contrib/admin/templates/admin/login.html:26
+#: contrib/admin/sites.py:325 contrib/admin/templates/admin/login.html:26
 #: contrib/admin/templates/registration/password_reset_complete.html:14
 #: contrib/admin/views/decorators.py:20
 msgid "Log in"
 msgstr "Logga in"
 
-#: contrib/admin/sites.py:373
+#: contrib/admin/sites.py:372
 #, python-format
 msgid "%s administration"
 msgstr "Administration av %s"
@@ -447,11 +447,11 @@ msgstr "Aktuell:"
 msgid "Change:"
 msgstr "Ändra:"
 
-#: contrib/admin/widgets.py:121
+#: contrib/admin/widgets.py:123
 msgid "Lookup"
 msgstr "Uppslag"
 
-#: contrib/admin/widgets.py:228
+#: contrib/admin/widgets.py:230
 msgid "Add Another"
 msgstr "Lägg till ytterligare"
 
@@ -904,7 +904,7 @@ msgstr "E-postadress:"
 msgid "Reset my password"
 msgstr "Nollställ mitt lösenord"
 
-#: contrib/admin/templatetags/admin_list.py:288
+#: contrib/admin/templatetags/admin_list.py:284
 msgid "All dates"
 msgstr "Alla datum"
 
@@ -2802,6 +2802,110 @@ msgstr "Telefonnummer måste vara i formatet XXXX-XXXXXX."
 msgid "Enter a valid postal code in the format XXXXXX"
 msgstr "Fyll i ett postnummer med formatet XXX XXX."
 
+#: contrib/localflavor/se/forms.py:35
+msgid "Enter a valid Swedish organisation number."
+msgstr "Fyll i ett giltigt svenskt organisationsnummer."
+
+#: contrib/localflavor/se/forms.py:69
+msgid "Enter a valid Swedish personal identity number."
+msgstr "Fyll i ett giltigt svenskt personnummer."
+
+#: contrib/localflavor/se/forms.py:70
+msgid "Enter a Swedish personal identity number with 10 digits (YYMMDD-NNNN)."
+msgstr "Fyll i ett svenskt personnummer med 10 siffror (YYMMDD-NNNN)."
+
+#: contrib/localflavor/se/forms.py:71
+msgid "Co-ordination numbers are not allowed."
+msgstr "Samordningsnummer är inte tillåtna."
+
+#: contrib/localflavor/se/forms.py:110
+msgid "Enter a Swedish postal code in the format XXXXX."
+msgstr "Fyll i ett svenskt postnummer med formatet XXXXX."
+
+#: contrib/localflavor/se/se_counties.py:16
+msgid "Stockholm County"
+msgstr "Stockholms län"
+
+#: contrib/localflavor/se/se_counties.py:17
+msgid "Västerbotten County"
+msgstr "Västerbottens län"
+
+#: contrib/localflavor/se/se_counties.py:18
+msgid "Norrbotten County"
+msgstr "Norrbottens län"
+
+#: contrib/localflavor/se/se_counties.py:19
+msgid "Uppsala County"
+msgstr "Uppsala län"
+
+#: contrib/localflavor/se/se_counties.py:20
+msgid "Södermanland County"
+msgstr "Södermanlands län"
+
+#: contrib/localflavor/se/se_counties.py:21
+msgid "Östergötland County"
+msgstr "Östergötlands län"
+
+#: contrib/localflavor/se/se_counties.py:22
+msgid "Jönköping County"
+msgstr "Jönköpings län"
+
+#: contrib/localflavor/se/se_counties.py:23
+msgid "Kronoberg County"
+msgstr "Kronobergs län"
+
+#: contrib/localflavor/se/se_counties.py:24
+msgid "Kalmar County"
+msgstr "Kalmar län"
+
+#: contrib/localflavor/se/se_counties.py:25
+msgid "Gotland County"
+msgstr "Gotlands län"
+
+#: contrib/localflavor/se/se_counties.py:26
+msgid "Blekinge County"
+msgstr "Blekinge län"
+
+#: contrib/localflavor/se/se_counties.py:27
+msgid "Skåne County"
+msgstr "Skåne län"
+
+#: contrib/localflavor/se/se_counties.py:28
+msgid "Halland County"
+msgstr "Hallands län"
+
+#: contrib/localflavor/se/se_counties.py:29
+msgid "Västra Götaland County"
+msgstr "Västa Götalands län"
+
+#: contrib/localflavor/se/se_counties.py:30
+msgid "Värmland County"
+msgstr "Värmlands län"
+
+#: contrib/localflavor/se/se_counties.py:31
+msgid "Örebro County"
+msgstr "Örebro län"
+
+#: contrib/localflavor/se/se_counties.py:32
+msgid "Västmanland County"
+msgstr "Västmanlands län"
+
+#: contrib/localflavor/se/se_counties.py:33
+msgid "Dalarna County"
+msgstr "Dalarnas län"
+
+#: contrib/localflavor/se/se_counties.py:34
+msgid "Gävleborg County"
+msgstr "Gävleborgs län"
+
+#: contrib/localflavor/se/se_counties.py:35
+msgid "Västernorrland County"
+msgstr "Västernorrlands län"
+
+#: contrib/localflavor/se/se_counties.py:36
+msgid "Jämtland County"
+msgstr "Jämtlands län"
+
 #: contrib/localflavor/sk/forms.py:30
 msgid "Enter a postal code in the format XXXXX or XXX XX."
 msgstr "Fyll i ett postnummer med formatet XXXXX eller XXX XX."
@@ -3711,7 +3815,7 @@ msgstr ""
 "Välj ett giltigt alternativ. %(value)s finns inte bland tillgängliga "
 "alternativ."
 
-#: forms/fields.py:697 forms/fields.py:758 forms/models.py:654
+#: forms/fields.py:697 forms/fields.py:758 forms/models.py:661
 msgid "Enter a list of values."
 msgstr "Fyll i en lista med värden."
 
@@ -3735,13 +3839,13 @@ msgstr "Sortering"
 msgid "%(model_name)s with this %(field_label)s already exists."
 msgstr "%(model_name)s med detta %(field_label)s finns redan."
 
-#: forms/models.py:584
+#: forms/models.py:591
 msgid "Select a valid choice. That choice is not one of the available choices."
 msgstr ""
 "Välj ett giltigt alternativ. Det valet finns inte bland tillgängliga "
 "alternativ."
 
-#: forms/models.py:655
+#: forms/models.py:662
 #, python-format
 msgid "Select a valid choice. %s is not one of the available choices."
 msgstr ""
@@ -4317,9 +4421,6 @@ msgstr "%(verbose_name)s togs bort."
 #~ msgid "This field must be given if %(field)s is not %(value)s"
 #~ msgstr "Detta fält måste anges om %(field)s inte är %(value)s"
 
-#~ msgid "Duplicate values are not allowed."
-#~ msgstr "Dubbletter är inte tillåtna."
-
 #~ msgid "This value must be between %(lower)s and %(upper)s."
 #~ msgstr "Detta värde måste vara mellan %(lower)s och %(upper)s."
 
diff --git a/django/contrib/localflavor/se/__init__.py b/django/contrib/localflavor/se/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/django/contrib/localflavor/se/forms.py b/django/contrib/localflavor/se/forms.py
new file mode 100644
index 0000000..4f26cc8
--- /dev/null
+++ b/django/contrib/localflavor/se/forms.py
@@ -0,0 +1,164 @@
+"""
+Swedish specific Form helpers
+"""
+
+from django import forms
+from django.utils.translation import ugettext_lazy as _
+from django.forms.fields import EMPTY_VALUES
+
+from utils import *
+
+__all__ = ('SECountySelect', 'SEMunicipalitySelect', 'SEOrganisationNumberField', 'SEPersonalIdentityNumberField', 'SEPostalCodeField')
+
+
+class SECountySelect(forms.Select):
+    """
+    A Select form widget that uses a list of the Swedish counties (län)
+    as its choices.
+
+    The cleaned value is the official county code -- see 
+    http://en.wikipedia.org/wiki/Counties_of_Sweden for a list.
+    """
+
+    def __init__(self, attrs=None):
+        from se_counties import COUNTY_CHOICES
+        super(SECountySelect, self).__init__(attrs=attrs, choices=COUNTY_CHOICES)
+
+
+class SEMunicipalitySelect(forms.Select):
+    """
+    A Select form widget that uses a list of the Swedish municipalities
+    (kommuner) as its choices.
+
+    Returns the official municipality code.
+    """
+
+    def __init__(self, attrs=None):
+        from se_municipalities import MUNICIPALITY_CHOICES
+        super(SEMunicipalitySelect, self).__init__(attrs, choices=MUNICIPALITY_CHOICES)
+
+
+class SEOrganisationNumberField(forms.CharField):
+    """
+    A form field that validates input as a Swedish organisation number
+    (organisationsnummer).
+
+    This fields accepts the same data as SEPersonalIdentityField (for 
+    sole proprietorships (enskild firma)), with the exception of
+    co-ordination numbers.
+    
+    It also accepts ordinary Swedish organisation numbers.
+
+    The correct formats are YYMMDD-XXXX and YYMMDDXXXX. YYMMDDXXXX will be
+    corrected to YYMMDD-XXXX.
+    
+    The YYMMDD+XXXX format has the same meaning as for SEPersonalIdentifyNumber
+    and can only be used if the organisation is a sole proprietorship
+    (enskildfirma).
+    """
+
+    default_error_messages = {
+        'invalid': _('Enter a valid Swedish organisation number.'),
+    }
+
+    def clean(self, value):
+        value = super(SEOrganisationNumberField, self).clean(value)
+        
+        if value in EMPTY_VALUES:
+            return u''
+        
+        match = SWEDISH_ID_NUMBER.match(value)
+        if not match:
+            raise forms.ValidationError(self.error_messages['invalid'])
+
+        gd = match.groupdict()
+        
+        # compare the calculated value with the checksum 
+        if id_number_checksum(gd) != int(gd['checksum']):
+            raise forms.ValidationError(self.error_messages['invalid'])
+
+        if not (valid_organisation(gd) or valid_id_birthday(gd, False)):
+            raise forms.ValidationError(self.error_messages['invalid'])
+
+        return format_id_number(gd)
+
+
+class SEPersonalIdentityNumberField(forms.CharField):
+    """
+    A form field that validates input as a Swedish personal identity number
+    (personnummer).
+
+    The correct formats are YYMMDD-XXXX, YYMMDD+XXXX and YYMMDDXXXX.
+    YYMMDDXXXX will be corrected to YYMMDD-XXXX.
+
+    \+ indicates that the person is more than 100 years old, which will be
+    taken into consideration when the date is validated.
+    
+    The checksum will be calculated and checked. The birth date is checked
+    to be a valid date.
+
+    By default, co-ordination numbers (samordningsnummer) will be accepted.
+    To only allow real personal identity numbers, pass the keyword argument
+    coordination_number=False to the constructor.
+    """
+
+    def __init__(self, *args, **kwargs):
+        self.coordination_number = kwargs.pop('coordination_number', True)
+        super(SEPersonalIdentityNumberField, self).__init__(*args, **kwargs)
+
+    default_error_messages = {
+        'invalid': _('Enter a valid Swedish personal identity number.'),
+        'invalid_length': _('Enter a Swedish personal identity number with 10 digits (YYMMDD-NNNN).'),
+        'coordination_number': _('Co-ordination numbers are not allowed.'),
+    }
+
+    def clean(self, value):
+        value = super(SEPersonalIdentityNumberField, self).clean(value)
+        
+        if value in EMPTY_VALUES:
+            return u''
+        
+        if LONG_SWEDISH_ID_NUMBER.match(value):
+            raise forms.ValidationError(self.error_messages['invalid_length'])
+        
+        match = SWEDISH_ID_NUMBER.match(value)
+        if not match:
+            raise forms.ValidationError(self.error_messages['invalid'])
+
+        gd = match.groupdict()
+        
+        # compare the calculated value with the checksum 
+        if id_number_checksum(gd) != int(gd['checksum']):
+            raise forms.ValidationError(self.error_messages['invalid'])
+
+        # check for valid birthday   
+        if not valid_id_birthday(gd):
+            raise forms.ValidationError(self.error_messages['invalid'])
+
+        # make sure that co-ordination numbers do not pass if not allowed 
+        if not self.coordination_number and int(gd['day']) > 60:
+            raise forms.ValidationError(self.error_messages['coordination_number'])
+  
+        return format_id_number(gd)
+
+
+class SEPostalCodeField(forms.RegexField):
+    """
+    A form field that validates input as a Swedish postal code (postnummer).
+    Valid codes consist of five digits (XXXXX). The number can optionally be
+    formatted with a space after the third digit (XXX XX).
+
+    The cleaned value will never contain the space. 
+    """
+
+    default_error_messages = {
+        'invalid': _('Enter a Swedish postal code in the format XXXXX.'),
+    }
+
+    def __init__(self, *args, **kwargs):
+        super(SEPostalCodeField, self).__init__(SE_POSTAL_CODE, *args, **kwargs)
+
+    def clean(self, value):
+        return super(SEPostalCodeField, self).clean(value).replace(' ', '')
+
+
diff --git a/django/contrib/localflavor/se/se_counties.py b/django/contrib/localflavor/se/se_counties.py
new file mode 100644
index 0000000..0944064
--- /dev/null
+++ b/django/contrib/localflavor/se/se_counties.py
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+"""
+A alphabetical list of Swedish counties, sorted by county codes.
+
+
+http://en.wikipedia.org/wiki/Counties_of_Sweden
+
+This exists in this standalone file so that it's only imported into memory
+when explicitly needed.
+
+"""
+
+from django.utils.translation import ugettext_lazy as _
+
+COUNTY_CHOICES = (
+    ('AB', _(u'Stockholm County')),
+    ('AC', _(u'Västerbotten County')),
+    ('BD', _(u'Norrbotten County')),
+    ('C', _(u'Uppsala County')),
+    ('D', _(u'Södermanland County')),
+    ('E', _(u'Östergötland County')),
+    ('F', _(u'Jönköping County')),
+    ('G', _(u'Kronoberg County')),
+    ('H', _(u'Kalmar County')),
+    ('I', _(u'Gotland County')),
+    ('K', _(u'Blekinge County')),
+    ('M', _(u'Skåne County')),
+    ('N', _(u'Halland County')),
+    ('O', _(u'Västra Götaland County')),
+    ('S', _(u'Värmland County')),
+    ('T', _(u'Örebro County')),
+    ('U', _(u'Västmanland County')),
+    ('W', _(u'Dalarna County')),
+    ('X', _(u'Gävleborg County')),
+    ('Y', _(u'Västernorrland County')),
+    ('Z', _(u'Jämtland County')),
+)
diff --git a/django/contrib/localflavor/se/se_municipalities.py b/django/contrib/localflavor/se/se_municipalities.py
new file mode 100644
index 0000000..2035dda
--- /dev/null
+++ b/django/contrib/localflavor/se/se_municipalities.py
@@ -0,0 +1,305 @@
+# -*- coding: utf-8 -*-
+"""
+An alphabetical list of Swedish municipalities for use as `choices` in a
+formfield.
+
+This exists in this standalone file so that it's only imported into memory
+when explicitly needed.
+
+This list was fetched 2008-10-03 from:
+http://www.ssd.scb.se/databaser/makro/visavar.asp?yp=duwird&xu=c5587001&lang=2&langdb=2&Fromwhere=S&omradekod=BE&huvudtabell=BefArealTathetKon&innehall=Areal&prodid=BE0101&deltabell=K1&fromSok=&preskat=O
+
+"""
+
+MUNICIPALITY_CHOICES = (
+    ('1440', u'Ale'),
+    ('1489', u'Alingsås'),
+    ('0764', u'Alvesta'),
+    ('0604', u'Aneby'),
+    ('1984', u'Arboga'),
+    ('2506', u'Arjeplog'),
+    ('2505', u'Arvidsjaur'),
+    ('1784', u'Arvika'),
+    ('1882', u'Askersund'),
+    ('2084', u'Avesta'),
+    ('1460', u'Bengtsfors'),
+    ('2326', u'Berg'),
+    ('2403', u'Bjurholm'),
+    ('1260', u'Bjuv'),
+    ('2582', u'Boden'),
+    ('1443', u'Bollebygd'),
+    ('2183', u'Bollnäs'),
+    ('0885', u'Borgholm'),
+    ('2081', u'Borlänge'),
+    ('1490', u'Borås'),
+    ('0127', u'Botkyrka'),
+    ('0560', u'Boxholm'),
+    ('1272', u'Bromölla'),
+    ('2305', u'Bräcke'),
+    ('1231', u'Burlöv'),
+    ('1278', u'Båstad'),
+    ('1438', u'Dals-Ed'),
+    ('0162', u'Danderyd'),
+    ('1862', u'Degerfors'),
+    ('2425', u'Dorotea'),
+    ('1730', u'Eda'),
+    ('0125', u'Ekerö'),
+    ('0686', u'Eksjö'),
+    ('0862', u'Emmaboda'),
+    ('0381', u'Enköping'),
+    ('0484', u'Eskilstuna'),
+    ('1285', u'Eslöv'),
+    ('1445', u'Essunga'),
+    ('1982', u'Fagersta'),
+    ('1382', u'Falkenberg'),
+    ('1499', u'Falköping'),
+    ('2080', u'Falun'),
+    ('1782', u'Filipstad'),
+    ('0562', u'Finspång'),
+    ('0482', u'Flen'),
+    ('1763', u'Forshaga'),
+    ('1439', u'Färgelanda'),
+    ('2026', u'Gagnef'),
+    ('0662', u'Gislaved'),
+    ('0461', u'Gnesta'),
+    ('0617', u'Gnosjö'),
+    ('0980', u'Gotland'),
+    ('1764', u'Grums'),
+    ('1444', u'Grästorp'),
+    ('1447', u'Gullspång'),
+    ('2523', u'Gällivare'),
+    ('2180', u'Gävle'),
+    ('1480', u'Göteborg'),
+    ('1471', u'Götene'),
+    ('0643', u'Habo'),
+    ('1783', u'Hagfors'),
+    ('1861', u'Hallsberg'),
+    ('1961', u'Hallstahammar'),
+    ('1380', u'Halmstad'),
+    ('1761', u'Hammarö'),
+    ('0136', u'Haninge'),
+    ('2583', u'Haparanda'),
+    ('0331', u'Heby'),
+    ('2083', u'Hedemora'),
+    ('1283', u'Helsingborg'),
+    ('1466', u'Herrljunga'),
+    ('1497', u'Hjo'),
+    ('2104', u'Hofors'),
+    ('0126', u'Huddinge'),
+    ('2184', u'Hudiksvall'),
+    ('0860', u'Hultsfred'),
+    ('1315', u'Hylte'),
+    ('1863', u'Hällefors'),
+    ('2361', u'Härjedalen'),
+    ('2280', u'Härnösand'),
+    ('1401', u'Härryda'),
+    ('1293', u'Hässleholm'),
+    ('0305', u'Håbo'),
+    ('1284', u'Höganäs'),
+    ('0821', u'Högsby'),
+    ('1266', u'Hörby'),
+    ('1267', u'Höör'),
+    ('2510', u'Jokkmokk'),
+    ('0123', u'Järfälla'),
+    ('0680', u'Jönköping'),
+    ('2514', u'Kalix'),
+    ('0880', u'Kalmar'),
+    ('1446', u'Karlsborg'),
+    ('1082', u'Karlshamn'),
+    ('1883', u'Karlskoga'),
+    ('1080', u'Karlskrona'),
+    ('1780', u'Karlstad'),
+    ('0483', u'Katrineholm'),
+    ('1715', u'Kil'),
+    ('0513', u'Kinda'),
+    ('2584', u'Kiruna'),
+    ('1276', u'Klippan'),
+    ('0330', u'Knivsta'),
+    ('2282', u'Kramfors'),
+    ('1290', u'Kristianstad'),
+    ('1781', u'Kristinehamn'),
+    ('2309', u'Krokom'),
+    ('1881', u'Kumla'),
+    ('1384', u'Kungsbacka'),
+    ('1960', u'Kungsör'),
+    ('1482', u'Kungälv'),
+    ('1261', u'Kävlinge'),
+    ('1983', u'Köping'),
+    ('1381', u'Laholm'),
+    ('1282', u'Landskrona'),
+    ('1860', u'Laxå'),
+    ('1814', u'Lekeberg'),
+    ('2029', u'Leksand'),
+    ('1441', u'Lerum'),
+    ('0761', u'Lessebo'),
+    ('0186', u'Lidingö'),
+    ('1494', u'Lidköping'),
+    ('1462', u'Lilla Edet'),
+    ('1885', u'Lindesberg'),
+    ('0580', u'Linköping'),
+    ('0781', u'Ljungby'),
+    ('2161', u'Ljusdal'),
+    ('1864', u'Ljusnarsberg'),
+    ('1262', u'Lomma'),
+    ('2085', u'Ludvika'),
+    ('2580', u'Luleå'),
+    ('1281', u'Lund'),
+    ('2481', u'Lycksele'),
+    ('1484', u'Lysekil'),
+    ('1280', u'Malmö'),
+    ('2023', u'Malung-Sälen'),
+    ('2418', u'Malå'),
+    ('1493', u'Mariestad'),
+    ('1463', u'Mark'),
+    ('0767', u'Markaryd'),
+    ('1461', u'Mellerud'),
+    ('0586', u'Mjölby'),
+    ('2062', u'Mora'),
+    ('0583', u'Motala'),
+    ('0642', u'Mullsjö'),
+    ('1430', u'Munkedal'),
+    ('1762', u'Munkfors'),
+    ('1481', u'Mölndal'),
+    ('0861', u'Mönsterås'),
+    ('0840', u'Mörbylånga'),
+    ('0182', u'Nacka'),
+    ('1884', u'Nora'),
+    ('1962', u'Norberg'),
+    ('2132', u'Nordanstig'),
+    ('2401', u'Nordmaling'),
+    ('0581', u'Norrköping'),
+    ('0188', u'Norrtälje'),
+    ('2417', u'Norsjö'),
+    ('0881', u'Nybro'),
+    ('0140', u'Nykvarn'),
+    ('0480', u'Nyköping'),
+    ('0192', u'Nynäshamn'),
+    ('0682', u'Nässjö'),
+    ('2101', u'Ockelbo'),
+    ('1060', u'Olofström'),
+    ('2034', u'Orsa'),
+    ('1421', u'Orust'),
+    ('1273', u'Osby'),
+    ('0882', u'Oskarshamn'),
+    ('2121', u'Ovanåker'),
+    ('0481', u'Oxelösund'),
+    ('2521', u'Pajala'),
+    ('1402', u'Partille'),
+    ('1275', u'Perstorp'),
+    ('2581', u'Piteå'),
+    ('2303', u'Ragunda'),
+    ('2409', u'Robertsfors'),
+    ('1081', u'Ronneby'),
+    ('2031', u'Rättvik'),
+    ('1981', u'Sala'),
+    ('0128', u'Salem'),
+    ('2181', u'Sandviken'),
+    ('0191', u'Sigtuna'),
+    ('1291', u'Simrishamn'),
+    ('1265', u'Sjöbo'),
+    ('1495', u'Skara'),
+    ('2482', u'Skellefteå'),
+    ('1904', u'Skinnskatteberg'),
+    ('1264', u'Skurup'),
+    ('1496', u'Skövde'),
+    ('2061', u'Smedjebacken'),
+    ('2283', u'Sollefteå'),
+    ('0163', u'Sollentuna'),
+    ('0184', u'Solna'),
+    ('2422', u'Sorsele'),
+    ('1427', u'Sotenäs'),
+    ('1230', u'Staffanstorp'),
+    ('1415', u'Stenungsund'),
+    ('0180', u'Stockholm'),
+    ('1760', u'Storfors'),
+    ('2421', u'Storuman'),
+    ('0486', u'Strängnäs'),
+    ('1486', u'Strömstad'),
+    ('2313', u'Strömsund'),
+    ('0183', u'Sundbyberg'),
+    ('2281', u'Sundsvall'),
+    ('1766', u'Sunne'),
+    ('1907', u'Surahammar'),
+    ('1214', u'Svalöv'),
+    ('1263', u'Svedala'),
+    ('1465', u'Svenljunga'),
+    ('1785', u'Säffle'),
+    ('2082', u'Säter'),
+    ('0684', u'Sävsjö'),
+    ('2182', u'Söderhamn'),
+    ('0582', u'Söderköping'),
+    ('0181', u'Södertälje'),
+    ('1083', u'Sölvesborg'),
+    ('1435', u'Tanum'),
+    ('1472', u'Tibro'),
+    ('1498', u'Tidaholm'),
+    ('0360', u'Tierp'),
+    ('2262', u'Timrå'),
+    ('0763', u'Tingsryd'),
+    ('1419', u'Tjörn'),
+    ('1270', u'Tomelilla'),
+    ('1737', u'Torsby'),
+    ('0834', u'Torsås'),
+    ('1452', u'Tranemo'),
+    ('0687', u'Tranås'),
+    ('1287', u'Trelleborg'),
+    ('1488', u'Trollhättan'),
+    ('0488', u'Trosa'),
+    ('0138', u'Tyresö'),
+    ('0160', u'Täby'),
+    ('1473', u'Töreboda'),
+    ('1485', u'Uddevalla'),
+    ('1491', u'Ulricehamn'),
+    ('2480', u'Umeå'),
+    ('0114', u'Upplands Väsby'),
+    ('0139', u'Upplands-Bro'),
+    ('0380', u'Uppsala'),
+    ('0760', u'Uppvidinge'),
+    ('0584', u'Vadstena'),
+    ('0665', u'Vaggeryd'),
+    ('0563', u'Valdemarsvik'),
+    ('0115', u'Vallentuna'),
+    ('2021', u'Vansbro'),
+    ('1470', u'Vara'),
+    ('1383', u'Varberg'),
+    ('0187', u'Vaxholm'),
+    ('1233', u'Vellinge'),
+    ('0685', u'Vetlanda'),
+    ('2462', u'Vilhelmina'),
+    ('0884', u'Vimmerby'),
+    ('2404', u'Vindeln'),
+    ('0428', u'Vingåker'),
+    ('1487', u'Vänersborg'),
+    ('2460', u'Vännäs'),
+    ('0120', u'Värmdö'),
+    ('0683', u'Värnamo'),
+    ('0883', u'Västervik'),
+    ('1980', u'Västerås'),
+    ('0780', u'Växjö'),
+    ('1442', u'Vårgårda'),
+    ('0512', u'Ydre'),
+    ('1286', u'Ystad'),
+    ('0765', u'Älmhult'),
+    ('2039', u'Älvdalen'),
+    ('0319', u'Älvkarleby'),
+    ('2560', u'Älvsbyn'),
+    ('1292', u'Ängelholm'),
+    ('1492', u'Åmål'),
+    ('2260', u'Ånge'),
+    ('2321', u'Åre'),
+    ('1765', u'Årjäng'),
+    ('2463', u'Åsele'),
+    ('1277', u'Åstorp'),
+    ('0561', u'Åtvidaberg'),
+    ('1407', u'Öckerö'),
+    ('0509', u'Ödeshög'),
+    ('1880', u'Örebro'),
+    ('1257', u'Örkelljunga'),
+    ('2284', u'Örnsköldsvik'),
+    ('2380', u'Östersund'),
+    ('0117', u'Österåker'),
+    ('0382', u'Östhammar'),
+    ('1256', u'Östra Göinge'),
+    ('2513', u'Överkalix'),
+    ('2518', u'Övertorneå'),
+)
diff --git a/django/contrib/localflavor/se/utils.py b/django/contrib/localflavor/se/utils.py
new file mode 100644
index 0000000..f9b3cc6
--- /dev/null
+++ b/django/contrib/localflavor/se/utils.py
@@ -0,0 +1,56 @@
+import re
+import time
+import datetime
+
+SWEDISH_ID_NUMBER = re.compile(r'^(?P<year>\d{2})(?P<month>\d{2})(?P<day>\d{2})(?P<sign>[\-+]?)(?P<serial>\d{3})(?P<checksum>\d)$')
+LONG_SWEDISH_ID_NUMBER = re.compile(r'^\d{8}[\-+]?\d{4}$')
+SE_POSTAL_CODE = re.compile(r'^[1-9]\d{2} ?\d{2}$')
+
+def id_number_checksum(gd):
+    """
+    Calculates a Swedish id number checksum  
+    """
+
+    n = s = 0
+    for c in (gd['year'] + gd['month'] + gd['day'] + gd['serial']):
+        tmp = ((n % 2) and 1 or 2) * int(c)
+        if tmp > 9:
+            tmp = sum([int(i) for i in str(tmp)])
+ 
+        s += tmp
+        n += 1
+  
+    return (((s / 10) + 1) * 10) - s
+
+def valid_id_birthday(gd, fix_coordination_number_day=True):
+
+    day = int(gd['day'])
+    if fix_coordination_number_day and day > 60:
+        day -= 60
+
+    current_year = datetime.date.today().year
+    year = int(time.strftime('%Y')) - int(time.strftime('%y')) + int(gd['year'])
+   
+    if ('%s%s%02d' % (gd['year'], gd['month'], day)) > time.strftime('%y%m%d'):
+        year -= 100
+
+    # if the person is older than 100 years
+    if gd['sign'] == '+':
+        year -= 100
+
+    # Make sure it is a valid date
+    try:
+        datetime.date(year, int(gd['month']), day)
+        return True
+    except ValueError:
+        return False
+
+def format_id_number(gd):
+    if not gd['sign']:
+        gd['sign'] = '-'
+
+    return unicode(gd['year'] + gd['month'] + gd['day'] + gd['sign'] + gd['serial'] + gd['checksum'])
+
+def valid_organisation(gd):
+    return int(gd['month']) >= 20 and gd['sign'] in ('-', '')
+
diff --git a/docs/ref/contrib/localflavor.txt b/docs/ref/contrib/localflavor.txt
index 6771efc..a6b6525 100644
--- a/docs/ref/contrib/localflavor.txt
+++ b/docs/ref/contrib/localflavor.txt
@@ -60,6 +60,7 @@ Countries currently supported by :mod:`~django.contrib.localflavor` are:
     * Slovakia_
     * `South Africa`_
     * Spain_
+    * Sweden_
     * Switzerland_
     * `United Kingdom`_
     * `United States of America`_
@@ -99,6 +100,7 @@ Here's an example of how to use them::
 .. _Slovakia: `Slovakia (sk)`_
 .. _South Africa: `South Africa (za)`_
 .. _Spain: `Spain (es)`_
+.. _Sweden: `Sweden (se)`_
 .. _Switzerland: `Switzerland (ch)`_
 .. _United Kingdom: `United Kingdom (uk)`_
 .. _United States of America: `United States of America (us)`_
@@ -573,6 +575,68 @@ Spain (``es``)
 
     A ``Select`` widget that uses a list of Spanish regions as its choices.
 
+Sweden (``se``)
+===============
+
+.. class:: se.forms.SECountySelect
+
+    A Select form widget that uses a list of the Swedish counties (län)
+    as its choices.
+
+    The cleaned value is the official county code -- see 
+    http://en.wikipedia.org/wiki/Counties_of_Sweden for a list.
+
+.. class:: se.forms.SEMunicipalitySelect
+
+    A Select form widget that uses a list of the Swedish municipalities
+    (kommuner) as its choices.
+
+    Returns the official municipality code.
+
+.. class:: se.forms.SEOrganisationNumber
+
+    A form field that validates input as a Swedish organisation number
+    (organisationsnummer).
+
+    This fields accepts the same data as SEPersonalIdentityField (for 
+    sole proprietorships (enskild firma)), with the exception of
+    co-ordination numbers.
+    
+    It also accepts ordinary Swedish organisation numbers.
+
+    The correct formats are YYMMDD-XXXX and YYMMDDXXXX. YYMMDDXXXX will be
+    corrected to YYMMDD-XXXX.
+    
+    The YYMMDD+XXXX format has the same meaning as for SEPersonalIdentifyNumber
+    and can only be used if the organisation is a sole proprietorship
+    (enskildfirma).
+
+.. class:: se.forms.SEPersonalIdentityNumber
+
+    A form field that validates input as a Swedish personal identity number
+    (personnummer).
+
+    The correct formats are YYMMDD-XXXX, YYMMDD+XXXX and YYMMDDXXXX.
+    YYMMDDXXXX will be corrected to YYMMDD-XXXX.
+
+    \+ indicates that the person is more than 100 years old, which will be
+    taken into consideration when the date is validated.
+    
+    The checksum will be calculated and checked. The birth date is checked
+    to be a valid date.
+
+    By default, co-ordination numbers (samordningsnummer) will be accepted.
+    To only allow real personal identity numbers, pass the keyword argument
+    coordination_number=False to the constructor.
+
+.. class:: se.forms.SEPostalCodeField
+
+    A form field that validates input as a Swedish postal code (postnummer).
+    Valid codes consist of five digits (XXXXX). The number can optionally be
+    formatted with a space after the third digit (XXX XX).
+
+    The cleaned value will never contain the space. 
+
 Switzerland (``ch``)
 ====================
 
diff --git a/tests/regressiontests/forms/localflavor/se.py b/tests/regressiontests/forms/localflavor/se.py
new file mode 100644
index 0000000..99553c7
--- /dev/null
+++ b/tests/regressiontests/forms/localflavor/se.py
@@ -0,0 +1,300 @@
+# -*- coding: utf-8 -*-
+# Tests for the contrib/localflavor/se form fields.
+
+tests = r"""
+
+# SECountySelect #####################################################
+>>> from django.contrib.localflavor.se.forms import SECountySelect
+
+>>> w = SECountySelect()
+>>> w.render('swedish_county', 'E')
+u'<select name="swedish_county">\n<option value="AB">Stockholm County</option>\n<option value="AC">V\xe4sterbotten County</option>\n<option value="BD">Norrbotten County</option>\n<option value="C">Uppsala County</option>\n<option value="D">S\xf6dermanland County</option>\n<option value="E" selected="selected">\xd6sterg\xf6tland County</option>\n<option value="F">J\xf6nk\xf6ping County</option>\n<option value="G">Kronoberg County</option>\n<option value="H">Kalmar County</option>\n<option value="I">Gotland County</option>\n<option value="K">Blekinge County</option>\n<option value="M">Sk\xe5ne County</option>\n<option value="N">Halland County</option>\n<option value="O">V\xe4stra G\xf6taland County</option>\n<option value="S">V\xe4rmland County</option>\n<option value="T">\xd6rebro County</option>\n<option value="U">V\xe4stmanland County</option>\n<option value="W">Dalarna County</option>\n<option value="X">G\xe4vleborg County</option>\n<option value="Y">V\xe4sternorrland County</option>\n<option value="Z">J\xe4mtland County</option>\n</select>'
+
+>>> from django.contrib.localflavor.se.forms import SEMunicipalitySelect
+>>> w = SEMunicipalitySelect()
+>>> w.render('swedish_municipalities', '0580')
+u'<select name="swedish_municipalities">\n<option value="1440">Ale</option>\n<option value="1489">Alings\xe5s</option>\n<option value="0764">Alvesta</option>\n<option value="0604">Aneby</option>\n<option value="1984">Arboga</option>\n<option value="2506">Arjeplog</option>\n<option value="2505">Arvidsjaur</option>\n<option value="1784">Arvika</option>\n<option value="1882">Askersund</option>\n<option value="2084">Avesta</option>\n<option value="1460">Bengtsfors</option>\n<option value="2326">Berg</option>\n<option value="2403">Bjurholm</option>\n<option value="1260">Bjuv</option>\n<option value="2582">Boden</option>\n<option value="1443">Bollebygd</option>\n<option value="2183">Bolln\xe4s</option>\n<option value="0885">Borgholm</option>\n<option value="2081">Borl\xe4nge</option>\n<option value="1490">Bor\xe5s</option>\n<option value="0127">Botkyrka</option>\n<option value="0560">Boxholm</option>\n<option value="1272">Brom\xf6lla</option>\n<option value="2305">Br\xe4cke</option>\n<option value="1231">Burl\xf6v</option>\n<option value="1278">B\xe5stad</option>\n<option value="1438">Dals-Ed</option>\n<option value="0162">Danderyd</option>\n<option value="1862">Degerfors</option>\n<option value="2425">Dorotea</option>\n<option value="1730">Eda</option>\n<option value="0125">Eker\xf6</option>\n<option value="0686">Eksj\xf6</option>\n<option value="0862">Emmaboda</option>\n<option value="0381">Enk\xf6ping</option>\n<option value="0484">Eskilstuna</option>\n<option value="1285">Esl\xf6v</option>\n<option value="1445">Essunga</option>\n<option value="1982">Fagersta</option>\n<option value="1382">Falkenberg</option>\n<option value="1499">Falk\xf6ping</option>\n<option value="2080">Falun</option>\n<option value="1782">Filipstad</option>\n<option value="0562">Finsp\xe5ng</option>\n<option value="0482">Flen</option>\n<option value="1763">Forshaga</option>\n<option value="1439">F\xe4rgelanda</option>\n<option value="2026">Gagnef</option>\n<option value="0662">Gislaved</option>\n<option value="0461">Gnesta</option>\n<option value="0617">Gnosj\xf6</option>\n<option value="0980">Gotland</option>\n<option value="1764">Grums</option>\n<option value="1444">Gr\xe4storp</option>\n<option value="1447">Gullsp\xe5ng</option>\n<option value="2523">G\xe4llivare</option>\n<option value="2180">G\xe4vle</option>\n<option value="1480">G\xf6teborg</option>\n<option value="1471">G\xf6tene</option>\n<option value="0643">Habo</option>\n<option value="1783">Hagfors</option>\n<option value="1861">Hallsberg</option>\n<option value="1961">Hallstahammar</option>\n<option value="1380">Halmstad</option>\n<option value="1761">Hammar\xf6</option>\n<option value="0136">Haninge</option>\n<option value="2583">Haparanda</option>\n<option value="0331">Heby</option>\n<option value="2083">Hedemora</option>\n<option value="1283">Helsingborg</option>\n<option value="1466">Herrljunga</option>\n<option value="1497">Hjo</option>\n<option value="2104">Hofors</option>\n<option value="0126">Huddinge</option>\n<option value="2184">Hudiksvall</option>\n<option value="0860">Hultsfred</option>\n<option value="1315">Hylte</option>\n<option value="1863">H\xe4llefors</option>\n<option value="2361">H\xe4rjedalen</option>\n<option value="2280">H\xe4rn\xf6sand</option>\n<option value="1401">H\xe4rryda</option>\n<option value="1293">H\xe4ssleholm</option>\n<option value="0305">H\xe5bo</option>\n<option value="1284">H\xf6gan\xe4s</option>\n<option value="0821">H\xf6gsby</option>\n<option value="1266">H\xf6rby</option>\n<option value="1267">H\xf6\xf6r</option>\n<option value="2510">Jokkmokk</option>\n<option value="0123">J\xe4rf\xe4lla</option>\n<option value="0680">J\xf6nk\xf6ping</option>\n<option value="2514">Kalix</option>\n<option value="0880">Kalmar</option>\n<option value="1446">Karlsborg</option>\n<option value="1082">Karlshamn</option>\n<option value="1883">Karlskoga</option>\n<option value="1080">Karlskrona</option>\n<option value="1780">Karlstad</option>\n<option value="0483">Katrineholm</option>\n<option value="1715">Kil</option>\n<option value="0513">Kinda</option>\n<option value="2584">Kiruna</option>\n<option value="1276">Klippan</option>\n<option value="0330">Knivsta</option>\n<option value="2282">Kramfors</option>\n<option value="1290">Kristianstad</option>\n<option value="1781">Kristinehamn</option>\n<option value="2309">Krokom</option>\n<option value="1881">Kumla</option>\n<option value="1384">Kungsbacka</option>\n<option value="1960">Kungs\xf6r</option>\n<option value="1482">Kung\xe4lv</option>\n<option value="1261">K\xe4vlinge</option>\n<option value="1983">K\xf6ping</option>\n<option value="1381">Laholm</option>\n<option value="1282">Landskrona</option>\n<option value="1860">Lax\xe5</option>\n<option value="1814">Lekeberg</option>\n<option value="2029">Leksand</option>\n<option value="1441">Lerum</option>\n<option value="0761">Lessebo</option>\n<option value="0186">Liding\xf6</option>\n<option value="1494">Lidk\xf6ping</option>\n<option value="1462">Lilla Edet</option>\n<option value="1885">Lindesberg</option>\n<option value="0580" selected="selected">Link\xf6ping</option>\n<option value="0781">Ljungby</option>\n<option value="2161">Ljusdal</option>\n<option value="1864">Ljusnarsberg</option>\n<option value="1262">Lomma</option>\n<option value="2085">Ludvika</option>\n<option value="2580">Lule\xe5</option>\n<option value="1281">Lund</option>\n<option value="2481">Lycksele</option>\n<option value="1484">Lysekil</option>\n<option value="1280">Malm\xf6</option>\n<option value="2023">Malung-S\xe4len</option>\n<option value="2418">Mal\xe5</option>\n<option value="1493">Mariestad</option>\n<option value="1463">Mark</option>\n<option value="0767">Markaryd</option>\n<option value="1461">Mellerud</option>\n<option value="0586">Mj\xf6lby</option>\n<option value="2062">Mora</option>\n<option value="0583">Motala</option>\n<option value="0642">Mullsj\xf6</option>\n<option value="1430">Munkedal</option>\n<option value="1762">Munkfors</option>\n<option value="1481">M\xf6lndal</option>\n<option value="0861">M\xf6nster\xe5s</option>\n<option value="0840">M\xf6rbyl\xe5nga</option>\n<option value="0182">Nacka</option>\n<option value="1884">Nora</option>\n<option value="1962">Norberg</option>\n<option value="2132">Nordanstig</option>\n<option value="2401">Nordmaling</option>\n<option value="0581">Norrk\xf6ping</option>\n<option value="0188">Norrt\xe4lje</option>\n<option value="2417">Norsj\xf6</option>\n<option value="0881">Nybro</option>\n<option value="0140">Nykvarn</option>\n<option value="0480">Nyk\xf6ping</option>\n<option value="0192">Nyn\xe4shamn</option>\n<option value="0682">N\xe4ssj\xf6</option>\n<option value="2101">Ockelbo</option>\n<option value="1060">Olofstr\xf6m</option>\n<option value="2034">Orsa</option>\n<option value="1421">Orust</option>\n<option value="1273">Osby</option>\n<option value="0882">Oskarshamn</option>\n<option value="2121">Ovan\xe5ker</option>\n<option value="0481">Oxel\xf6sund</option>\n<option value="2521">Pajala</option>\n<option value="1402">Partille</option>\n<option value="1275">Perstorp</option>\n<option value="2581">Pite\xe5</option>\n<option value="2303">Ragunda</option>\n<option value="2409">Robertsfors</option>\n<option value="1081">Ronneby</option>\n<option value="2031">R\xe4ttvik</option>\n<option value="1981">Sala</option>\n<option value="0128">Salem</option>\n<option value="2181">Sandviken</option>\n<option value="0191">Sigtuna</option>\n<option value="1291">Simrishamn</option>\n<option value="1265">Sj\xf6bo</option>\n<option value="1495">Skara</option>\n<option value="2482">Skellefte\xe5</option>\n<option value="1904">Skinnskatteberg</option>\n<option value="1264">Skurup</option>\n<option value="1496">Sk\xf6vde</option>\n<option value="2061">Smedjebacken</option>\n<option value="2283">Sollefte\xe5</option>\n<option value="0163">Sollentuna</option>\n<option value="0184">Solna</option>\n<option value="2422">Sorsele</option>\n<option value="1427">Soten\xe4s</option>\n<option value="1230">Staffanstorp</option>\n<option value="1415">Stenungsund</option>\n<option value="0180">Stockholm</option>\n<option value="1760">Storfors</option>\n<option value="2421">Storuman</option>\n<option value="0486">Str\xe4ngn\xe4s</option>\n<option value="1486">Str\xf6mstad</option>\n<option value="2313">Str\xf6msund</option>\n<option value="0183">Sundbyberg</option>\n<option value="2281">Sundsvall</option>\n<option value="1766">Sunne</option>\n<option value="1907">Surahammar</option>\n<option value="1214">Sval\xf6v</option>\n<option value="1263">Svedala</option>\n<option value="1465">Svenljunga</option>\n<option value="1785">S\xe4ffle</option>\n<option value="2082">S\xe4ter</option>\n<option value="0684">S\xe4vsj\xf6</option>\n<option value="2182">S\xf6derhamn</option>\n<option value="0582">S\xf6derk\xf6ping</option>\n<option value="0181">S\xf6dert\xe4lje</option>\n<option value="1083">S\xf6lvesborg</option>\n<option value="1435">Tanum</option>\n<option value="1472">Tibro</option>\n<option value="1498">Tidaholm</option>\n<option value="0360">Tierp</option>\n<option value="2262">Timr\xe5</option>\n<option value="0763">Tingsryd</option>\n<option value="1419">Tj\xf6rn</option>\n<option value="1270">Tomelilla</option>\n<option value="1737">Torsby</option>\n<option value="0834">Tors\xe5s</option>\n<option value="1452">Tranemo</option>\n<option value="0687">Tran\xe5s</option>\n<option value="1287">Trelleborg</option>\n<option value="1488">Trollh\xe4ttan</option>\n<option value="0488">Trosa</option>\n<option value="0138">Tyres\xf6</option>\n<option value="0160">T\xe4by</option>\n<option value="1473">T\xf6reboda</option>\n<option value="1485">Uddevalla</option>\n<option value="1491">Ulricehamn</option>\n<option value="2480">Ume\xe5</option>\n<option value="0114">Upplands V\xe4sby</option>\n<option value="0139">Upplands-Bro</option>\n<option value="0380">Uppsala</option>\n<option value="0760">Uppvidinge</option>\n<option value="0584">Vadstena</option>\n<option value="0665">Vaggeryd</option>\n<option value="0563">Valdemarsvik</option>\n<option value="0115">Vallentuna</option>\n<option value="2021">Vansbro</option>\n<option value="1470">Vara</option>\n<option value="1383">Varberg</option>\n<option value="0187">Vaxholm</option>\n<option value="1233">Vellinge</option>\n<option value="0685">Vetlanda</option>\n<option value="2462">Vilhelmina</option>\n<option value="0884">Vimmerby</option>\n<option value="2404">Vindeln</option>\n<option value="0428">Ving\xe5ker</option>\n<option value="1487">V\xe4nersborg</option>\n<option value="2460">V\xe4nn\xe4s</option>\n<option value="0120">V\xe4rmd\xf6</option>\n<option value="0683">V\xe4rnamo</option>\n<option value="0883">V\xe4stervik</option>\n<option value="1980">V\xe4ster\xe5s</option>\n<option value="0780">V\xe4xj\xf6</option>\n<option value="1442">V\xe5rg\xe5rda</option>\n<option value="0512">Ydre</option>\n<option value="1286">Ystad</option>\n<option value="0765">\xc4lmhult</option>\n<option value="2039">\xc4lvdalen</option>\n<option value="0319">\xc4lvkarleby</option>\n<option value="2560">\xc4lvsbyn</option>\n<option value="1292">\xc4ngelholm</option>\n<option value="1492">\xc5m\xe5l</option>\n<option value="2260">\xc5nge</option>\n<option value="2321">\xc5re</option>\n<option value="1765">\xc5rj\xe4ng</option>\n<option value="2463">\xc5sele</option>\n<option value="1277">\xc5storp</option>\n<option value="0561">\xc5tvidaberg</option>\n<option value="1407">\xd6cker\xf6</option>\n<option value="0509">\xd6desh\xf6g</option>\n<option value="1880">\xd6rebro</option>\n<option value="1257">\xd6rkelljunga</option>\n<option value="2284">\xd6rnsk\xf6ldsvik</option>\n<option value="2380">\xd6stersund</option>\n<option value="0117">\xd6ster\xe5ker</option>\n<option value="0382">\xd6sthammar</option>\n<option value="1256">\xd6stra G\xf6inge</option>\n<option value="2513">\xd6verkalix</option>\n<option value="2518">\xd6vertorne\xe5</option>\n</select>'
+
+
+
+
+# SEOrganisationNumberField #######################################
+
+>>> from django.contrib.localflavor.se.forms import SEOrganisationNumberField
+
+>>> f = SEOrganisationNumberField()
+
+# Check ordinary personal identity numbers first
+>>> f.clean('870512-1989')
+u'870512-1989'
+>>> f.clean('870512-2128')
+u'870512-2128'
+>>> f.clean('081015-6315')
+u'081015-6315'
+>>> f.clean('081015+6315')
+u'081015+6315'
+>>> f.clean('0810156315')
+u'081015-6315'
+>>> f.clean('081015 6315')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid Swedish organisation number.']
+
+>>> f.clean('950231-4496')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid Swedish organisation number.']
+
+Invalid date - month 14
+>>> f.clean('6914104499')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid Swedish organisation number.']
+
+No special treatment for 12 (four year digits) digits
+>>> f.clean('19870512-1989')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid Swedish organisation number.']
+
+# Invalid value
+>>> f.clean('950d314496')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid Swedish organisation number.']
+
+>>> f.clean('invalid!!!')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid Swedish organisation number.']
+
+# Invalid checksum
+>>> f.clean('870514-1111')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid Swedish organisation number.']
+
+# Empty values
+>>> f.clean('')
+Traceback (most recent call last):
+...
+ValidationError: [u'This field is required.']
+
+>>> f.clean(None)
+Traceback (most recent call last):
+...
+ValidationError: [u'This field is required.']
+
+# Co-ordination number checking
+# Co-ordination numbers are not valid organisation numbers
+
+>>> f.clean('870574-1315')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid Swedish organisation number.']
+
+>>> f.clean('870573-1311')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid Swedish organisation number.']
+
+# Test some different organisation numbers
+>>> f.clean('556074-7569') # IKEA Linköping
+u'556074-7569'
+
+>>> f.clean('556074-3089') # Volvo Personvagnar
+u'556074-3089'
+
+>>> f.clean('822001-5476') # LJS (organisation)
+u'822001-5476'
+
+>>> f.clean('8220015476') # LJS (organisation)
+u'822001-5476'
+
+>>> f.clean('212000-0449') # Katedralskolan Linköping (school)
+u'212000-0449'
+
+>>> f.clean('556074+3089') # Volvo Personvagnar, bad formatting
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid Swedish organisation number.']
+
+
+# Empty values with required=False
+>>> f = SEOrganisationNumberField(required=False)
+
+>>> f.clean(None)
+u''
+
+>>> f.clean('')
+u''
+
+
+
+# SEPersonalIdentityNumberField #######################################
+
+>>> from django.contrib.localflavor.se.forms import SEPersonalIdentityNumberField
+
+>>> f = SEPersonalIdentityNumberField()
+>>> f.clean('870512-1989')
+u'870512-1989'
+
+>>> f.clean('870512-2128')
+u'870512-2128'
+
+The date and the extra numbers can be separated by - or +
+>>> f.clean('081015-6315')
+u'081015-6315'
+
+>>> f.clean('081015+6315')
+u'081015+6315'
+
+>>> f.clean('0810156315')
+u'081015-6315'
+
+Separation by space are not allowed
+>>> f.clean('081015 6315')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid Swedish personal identity number.']
+
+February 31st does not exist
+>>> f.clean('950231-4496')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid Swedish personal identity number.']
+
+Invalid date - month 14
+>>> f.clean('6914104499')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid Swedish personal identity number.']
+
+12 (four year digits) digit numbers are not allowed
+>>> f.clean('19870512-1989')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a Swedish personal identity number with 10 digits (YYMMDD-NNNN).']
+
+# Invalid value
+>>> f.clean('950d314496')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid Swedish personal identity number.']
+
+>>> f.clean('invalid!!!')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid Swedish personal identity number.']
+
+# Invalid checksum
+>>> f.clean('870514-1111')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid Swedish personal identity number.']
+
+# Empty values
+>>> f.clean('')
+Traceback (most recent call last):
+...
+ValidationError: [u'This field is required.']
+
+>>> f.clean(None)
+Traceback (most recent call last):
+...
+ValidationError: [u'This field is required.']
+
+# Co-ordination number checking
+>>> f.clean('870574-1315')
+u'870574-1315'
+
+>>> f.clean('870574+1315')
+u'870574+1315'
+
+>>> f.clean('870573-1311')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid Swedish personal identity number.']
+
+# Check valid co-ordination numbers, that should not be accepted 
+# because of coordination_number=False
+>>> f = SEPersonalIdentityNumberField(coordination_number=False)
+
+>>> f.clean('870574-1315')
+Traceback (most recent call last):
+...
+ValidationError: [u'Co-ordination numbers are not allowed.']
+
+>>> f.clean('870574+1315')
+Traceback (most recent call last):
+...
+ValidationError: [u'Co-ordination numbers are not allowed.']
+
+>>> f.clean('8705741315')
+Traceback (most recent call last):
+...
+ValidationError: [u'Co-ordination numbers are not allowed.']
+
+# Invalid co-ordination numbers should be treated as invalid, and not
+# as co-ordination numbers
+>>> f.clean('870573-1311')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a valid Swedish personal identity number.']
+
+# Empty values with required=False
+>>> f = SEPersonalIdentityNumberField(required=False)
+
+>>> f.clean(None)
+u''
+
+>>> f.clean('')
+u''
+
+# SEPostalCodeField ###############################################
+>>> from django.contrib.localflavor.se.forms import SEPostalCodeField
+>>> f = SEPostalCodeField()
+>>>
+Postal codes can have spaces
+>>> f.clean('589 37')
+u'58937'
+
+... but the dont have to
+>>> f.clean('58937')
+u'58937'
+>>> f.clean('abcasfassadf')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a Swedish postal code in the format XXXXX.']
+
+# Only one space is allowed for separation
+>>> f.clean('589  37')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a Swedish postal code in the format XXXXX.']
+
+# The postal code must not start with 0
+>>> f.clean('01234')
+Traceback (most recent call last):
+...
+ValidationError: [u'Enter a Swedish postal code in the format XXXXX.']
+
+# Empty values
+>>> f.clean('')
+Traceback (most recent call last):
+...
+ValidationError: [u'This field is required.']
+
+>>> f.clean(None)
+Traceback (most recent call last):
+...
+ValidationError: [u'This field is required.']
+
+# Empty values, required=False
+>>> f = SEPostalCodeField(required=False)
+>>> f.clean('')
+u''
+>>> f.clean(None)
+u''
+
+"""
diff --git a/tests/regressiontests/forms/tests.py b/tests/regressiontests/forms/tests.py
index 6a8b017..f930003 100644
--- a/tests/regressiontests/forms/tests.py
+++ b/tests/regressiontests/forms/tests.py
@@ -21,6 +21,7 @@ from localflavor.jp import tests as localflavor_jp_tests
 from localflavor.nl import tests as localflavor_nl_tests
 from localflavor.pl import tests as localflavor_pl_tests
 from localflavor.ro import tests as localflavor_ro_tests
+from localflavor.se import tests as localflavor_se_tests
 from localflavor.sk import tests as localflavor_sk_tests
 from localflavor.uk import tests as localflavor_uk_tests
 from localflavor.us import tests as localflavor_us_tests
@@ -54,6 +55,7 @@ __test__ = {
     'localflavor_nl_tests': localflavor_nl_tests,
     'localflavor_pl_tests': localflavor_pl_tests,
     'localflavor_ro_tests': localflavor_ro_tests,
+    'localflavor_se_tests': localflavor_se_tests,
     'localflavor_sk_tests': localflavor_sk_tests,
     'localflavor_uk_tests': localflavor_uk_tests,
     'localflavor_us_tests': localflavor_us_tests,
