Commits

Branko Vukelic committed dd0449c

Added copyright and license to all modules

  • Participants
  • Parent commits b443aea

Comments (0)

Files changed (3)

File international/forms.py

-"""Country and currency forms
-
-Settings
-========
-
-There are a few settings you can use to configure the behavior of the forms.
-Note that these settings are for the form mixins, and not the form classes. So
-forms that contain both country and currency form mixins will be affected by
-both sets of
-
-COUNTRY_FORM_LABEL
-------------------
+"""
+This file is part of django-international.
+Copyright (c) 2012 Monwara LLC.
+All rights reserved.
 
-Label for the 'country' field. Defaults to 'country'.
+Licensed under BSD license. See LICENSE file for more details.
+"""
 
-COUNTRY_FORM_INCLUDE_EMPTY
---------------------------
+from __future__ import unicode_literals
 
-This settings controls whether country form will include empty value when
-instantiated. You can also use the ``COUNTRY_FORM_EMPTY_VALUE`` to control the
-value of the item that will be treted as empty (no country). Default is
-``False``.
+from django import forms
+from django.utils.translation import ugettext as _
 
-COUNTRY_FORM_EMPTY_VALUE
-------------------------
+import settings
+from models import currencies, countries, Country
 
-This setting controls the value that is assigned to empty value (no country) if
-``COUNTRY_FORM_INCLUDE_EMPTY`` is set to ``True``.
+def get_arg(kwarg, arg_name, default):
+    arg_val = default
+    if arg_name in kwarg:
+        arg_val = kwarg[arg_name]
+        del kwarg[arg_name]
+    return arg_val, kwarg
 
-COUNTRY_FORM_EMPTY_LABEL
-------------------------
 
-Customizes the label for the empty value (no country). Default is 'All
-countries'.
 
-COUNTRY_FORM_USE_STATIC
------------------------
+class CountryForm(forms.Form):
+    """Country form
 
-Use hard-coded values instead of reading the database.
+    Following settings are applicable:
 
-CURRENCY_FORM_LABEL
--------------------
 
-Label for the 'currency' field. Defaults to 'currency'.
+    COUNTRY_FORM_LABEL
+    ------------------
 
-CURRENCY_FORM_INCLUDE_EMPTY
----------------------------
+    Label for the 'country' field. Defaults to 'country'.
 
-Same as ``COUNTRY_FORM_INCLUDE_EMPTY`` but for currency form.
+    COUNTRY_FORM_INCLUDE_EMPTY
+    --------------------------
 
-CURRENCY_FORM_EMPTY_VALUE
--------------------------
+    This settings controls whether country form will include empty value when
+    instantiated. You can also use the ``COUNTRY_FORM_EMPTY_VALUE`` to control the
+    value of the item that will be treted as empty (no country). Default is
+    ``False``.
 
-Same as ``COUNTRY_FORM_EMPTY_VALUE`` but for currency form.
+    COUNTRY_FORM_EMPTY_VALUE
+    ------------------------
 
-CURRENCY_FORM_EMPTY_LABEL
--------------------------
+    This setting controls the value that is assigned to empty value (no country) if
+    ``COUNTRY_FORM_INCLUDE_EMPTY`` is set to ``True``.
 
-Same as ``COUNTRY_FORM_EMPTY_LABEL`` but for currency form. Defaults to 'All
-currencies'.
+    COUNTRY_FORM_EMPTY_LABEL
+    ------------------------
 
-"""
+    Customizes the label for the empty value (no country). Default is 'All
+    countries'.
 
-from __future__ import unicode_literals
+    COUNTRY_FORM_USE_STATIC
+    -----------------------
 
-from django import forms
-from django.utils.translation import ugettext as _
+    Use hard-coded values instead of reading the database.
 
-import settings
-from models import currencies, countries, Country
+    """
 
-def get_arg(kwarg, arg_name, default):
-    arg_val = default
-    if arg_name in kwarg:
-        arg_val = kwarg[arg_name]
-        del kwarg[arg_name]
-    return arg_val, kwarg
-
-
-
-class CountryForm(forms.Form):
     def __init__(self, *arg, **kwarg):
         use_static, kwarg = get_arg(kwarg, 'use_static',
                                     settings.COUNTRY_FORM_USE_STATIC)
 
 
 class CurrencyForm(forms.Form):
+    """Currency form
+
+    Following settings are applicable:
+
+
+    CURRENCY_FORM_LABEL
+    -------------------
+
+    Label for the 'currency' field. Defaults to 'currency'.
+
+    CURRENCY_FORM_INCLUDE_EMPTY
+    ---------------------------
+
+    Same as ``COUNTRY_FORM_INCLUDE_EMPTY`` but for currency form.
+
+    CURRENCY_FORM_EMPTY_VALUE
+    -------------------------
+
+    Same as ``COUNTRY_FORM_EMPTY_VALUE`` but for currency form.
+
+    CURRENCY_FORM_EMPTY_LABEL
+    -------------------------
+
+    Same as ``COUNTRY_FORM_EMPTY_LABEL`` but for currency form. Defaults to 'All
+    currencies'.
+
+    """
+
     def __init__(self, *arg, **kwarg):
         include_empty, kwarg = get_arg(kwarg, 'include_empty',
                                        settings.CURRENCY_FORM_INCLUDE_EMPTY)

File international/models.py

 # -*- coding: utf-8 -*-
+"""
+This file is part of django-international.
+Copyright (c) 2012 Monwara LLC.
+All rights reserved.
+
+Licensed under BSD license. See LICENSE file for more details.
+"""
+
+from __future__ import unicode_literals
+
+from django.db import models
+from django.utils.translation import ugettext as _
+
 
 """Countries and currencies
 
 
 """
 
-
-from __future__ import unicode_literals
-
-from django.db import models
-from django.utils.translation import ugettext as _
-
 countries_raw = (
     ("AS", "AF", "AFG", 4, _("Afghanistan, Islamic Republic of")),
     ("EU", "AL", "ALB", 8, _("Albania, Republic of")),

File international/settings.py

+"""
+This file is part of django-international.
+Copyright (c) 2012 Monwara LLC.
+All rights reserved.
+
+Licensed under BSD license. See LICENSE file for more details.
+"""
+
 from __future__ import unicode_literals
 
 from django.utils.translation import ugettext as _