From da74b5f919669ba3819e0f94d0061f125c8a1e3d Mon Sep 17 00:00:00 2001 From: dishansa Date: Mon, 24 Jul 2023 14:06:59 +0530 Subject: [PATCH 01/20] Add Sri Lanka provinces --- localflavor/lk/lk_provinces.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 localflavor/lk/lk_provinces.py diff --git a/localflavor/lk/lk_provinces.py b/localflavor/lk/lk_provinces.py new file mode 100644 index 00000000..28f79e22 --- /dev/null +++ b/localflavor/lk/lk_provinces.py @@ -0,0 +1,26 @@ +""" +List of Provinces of Sri Lanka. + +Source: https://en.wikipedia.org/wiki/Provinces_of_Sri_Lanka + +Sri Lanka province list choices are in this format: + + ('name_of_province',_('Name of province')), + +eg. + ('central', _('Central')), +""" + +from django.utils.translation import gettext_lazy as _ + +PROVINCES = [ + ('central', _('Central')), + ('north_central', _('North Central')), + ('northern', _('Northern')), + ('eastern', _('Eastern')), + ('north_western', _('North Western')), + ('southern', _('Southern')), + ('uva', _('Uva')), + ('sabaragamuwa', _('Sabaragamuwa')), + ('western', _('Western')), +] \ No newline at end of file From d3315fd5a69d5ca42baa98af80f1580d9298d69d Mon Sep 17 00:00:00 2001 From: dishansa Date: Mon, 24 Jul 2023 14:27:38 +0530 Subject: [PATCH 02/20] Add Sri Lanka Districts --- localflavor/lk/lk_districts.py | 76 ++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 localflavor/lk/lk_districts.py diff --git a/localflavor/lk/lk_districts.py b/localflavor/lk/lk_districts.py new file mode 100644 index 00000000..af177949 --- /dev/null +++ b/localflavor/lk/lk_districts.py @@ -0,0 +1,76 @@ +""" +List of Districts of Sri Lanka. + +Source: https://en.wikipedia.org/wiki/Districts_of_Sri_Lanka + +Sri Lanka districts list choices are in this format: + + ('name_of_districts',_('Name of districts')), + +eg. + ('name_of_district', _('Name of district')), +""" + +from django.utils.translation import gettext_lazy as _ + +# list of districts in Central +CENTRAL_DISTRICTS = [ + ('kandy', _('Kandy')), + ('matale', _('Matale')), + ('nuwara_eliya', _('Nuwara Eliya')), +] + +# list of districts in North Central +NORTH_CENTRAL_DISTRICTS = [ + ('anuradhapura', _('Anuradhapura')), + ('polonnaruwa', _('Polonnaruwa')), +] + +# list of districts in Northern +NORTHERN_DISTRICTS = [ + ('jaffna', _('Jaffna')), + ('kilinochchi', _('Kilinochchi')), + ('mannar', _('Mannar')), + ('vavuniya', _('Vavuniya')), + ('mullativu', _('Mullativu')), + ('alambil', _('Alambil')), +] + +# list of districts in Eastern +EASTERN_DISTRICTS = [ + ('ampara', _('Ampara')), + ('batticaloa', _('Batticaloa')), + ('trincomalee', _('Trincomalee')), +] + +# list of districts in North Western +NORTH_WESTERN_DISTRICTS = [ + ('kurunagala', _('Kurunagala')), + ('puttalam', _('Puttalam')), +] + +# list of districts in Southern +SOUTHERN_DISTRICTS = [ + ('galle', _('Galle')), + ('hambanthota', _('Hambanthota')), + ('mathara', _('Mathara')), +] + +# list of districts in Uva +UVA_DISTRICTS = [ + ('badulla', _('Badulla')), + ('monaragala', _('Monaragala')), +] + +# list of districts in Sabaragamuwa +SABARAGAMUWA_DISTRICTS = [ + ('kegalle', _('Kegalle')), + ('rathnapura', _('Rathnapura')), +] + +# list of districts in Western +WESTERN_DISTRICTS = [ + ('colombo', _('Colombo')), + ('gampaha', _('Gampaha')), + ('kaluthara', _('Kaluthara')), +] \ No newline at end of file From 34ff82b34cfebcd8c5321e003f786cc25a2cd3cf Mon Sep 17 00:00:00 2001 From: dishansa Date: Mon, 24 Jul 2023 14:53:30 +0530 Subject: [PATCH 03/20] combine and alphabetically sort list of Sri Lanka districts --- localflavor/lk/lk_districts.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/localflavor/lk/lk_districts.py b/localflavor/lk/lk_districts.py index af177949..53939d23 100644 --- a/localflavor/lk/lk_districts.py +++ b/localflavor/lk/lk_districts.py @@ -73,4 +73,10 @@ ('colombo', _('Colombo')), ('gampaha', _('Gampaha')), ('kaluthara', _('Kaluthara')), -] \ No newline at end of file +] + +# Combining all the district lists from different provinces into a single list +DISTRICTS = CENTRAL_DISTRICTS + NORTH_CENTRAL_DISTRICTS + NORTHERN_DISTRICTS + EASTERN_DISTRICTS + NORTH_WESTERN_DISTRICTS + SOUTHERN_DISTRICTS + UVA_DISTRICTS + SABARAGAMUWA_DISTRICTS + WESTERN_DISTRICTS + +# Alphabetically sorting the list of all districts based on their names (first element of each tuple) +DISTRICTS.sort(key=lambda district: district[0]) \ No newline at end of file From 4c76e6277a515035a405979b261398a323a0a0a3 Mon Sep 17 00:00:00 2001 From: dishansa Date: Mon, 24 Jul 2023 14:55:35 +0530 Subject: [PATCH 04/20] add the LKPostalCodeFormField --- localflavor/lk/forms.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 localflavor/lk/forms.py diff --git a/localflavor/lk/forms.py b/localflavor/lk/forms.py new file mode 100644 index 00000000..9c6ea9b5 --- /dev/null +++ b/localflavor/lk/forms.py @@ -0,0 +1,20 @@ +"""Sri Lanka specific Form helpers.""" + +from django.forms.fields import RegexField +from django.utils.translation import gettext_lazy as _ + + +class LKPostalCodeFormField(RegexField): + """ + A form field that accepts Sri Lanka postal code. + Format : XXXXX + + Postal codes: https://en.wikipedia.org/wiki/Postal_codes_in_Sri_Lanka + """ + + default_error_messages = { + 'invalid': _('Enter a postal code in format XXXXX'), + } + + def __init__(self, **kwargs): + super().__init__(r'^\d{5}$', **kwargs) From df09fc62e988b064bcf8739229abdce99d5ce67e Mon Sep 17 00:00:00 2001 From: dishansa Date: Mon, 24 Jul 2023 14:57:07 +0530 Subject: [PATCH 05/20] add the LKProvinceSelect form field --- localflavor/lk/forms.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/localflavor/lk/forms.py b/localflavor/lk/forms.py index 9c6ea9b5..e3db5b6a 100644 --- a/localflavor/lk/forms.py +++ b/localflavor/lk/forms.py @@ -1,8 +1,10 @@ """Sri Lanka specific Form helpers.""" -from django.forms.fields import RegexField +from django.forms.fields import RegexField, Select from django.utils.translation import gettext_lazy as _ +from .lk_provinces import PROVINCES + class LKPostalCodeFormField(RegexField): """ @@ -18,3 +20,13 @@ class LKPostalCodeFormField(RegexField): def __init__(self, **kwargs): super().__init__(r'^\d{5}$', **kwargs) + + +class LKProvinceSelect(Select): + """ + A Select widget with option to select a provinces from + list of all provinces of Sri Lanka. + """ + + def __init__(self, attrs=None): + super().__init__(attrs, choices=PROVINCES) From 40f135602bb45babb7eaeb4fbefb463a0b7355a7 Mon Sep 17 00:00:00 2001 From: dishansa Date: Mon, 24 Jul 2023 15:00:46 +0530 Subject: [PATCH 06/20] add the LKDistrictsSelect form field --- localflavor/lk/forms.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/localflavor/lk/forms.py b/localflavor/lk/forms.py index e3db5b6a..4f608176 100644 --- a/localflavor/lk/forms.py +++ b/localflavor/lk/forms.py @@ -4,6 +4,7 @@ from django.utils.translation import gettext_lazy as _ from .lk_provinces import PROVINCES +from .lk_districts import DISTRICTS class LKPostalCodeFormField(RegexField): @@ -30,3 +31,13 @@ class LKProvinceSelect(Select): def __init__(self, attrs=None): super().__init__(attrs, choices=PROVINCES) + + +class LKDistrictsSelect(Select): + """ + A Select widget with option to select a districts from + list of all districts of Sri Lanka. + """ + + def __init__(self, attrs=None): + super().__init__(attrs, choices=DISTRICTS) From 881b2710f2569b6122853e3a82c882113fcd2122 Mon Sep 17 00:00:00 2001 From: dishansa Date: Mon, 24 Jul 2023 15:03:12 +0530 Subject: [PATCH 07/20] Add init.py --- localflavor/lk/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 localflavor/lk/__init__.py diff --git a/localflavor/lk/__init__.py b/localflavor/lk/__init__.py new file mode 100644 index 00000000..e69de29b From 96a6a26bb010048f56101f51c1bbb78dd658cac1 Mon Sep 17 00:00:00 2001 From: dishansa Date: Mon, 24 Jul 2023 15:21:13 +0530 Subject: [PATCH 08/20] add the LKPostalCodeField --- localflavor/lk/models.py | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 localflavor/lk/models.py diff --git a/localflavor/lk/models.py b/localflavor/lk/models.py new file mode 100644 index 00000000..186e06fe --- /dev/null +++ b/localflavor/lk/models.py @@ -0,0 +1,41 @@ +"""Sri Lanka specific Model fields""" + +import re + +from django.core.validators import RegexValidator +from django.db import models +from django.utils.translation import gettext_lazy as _ + +from .forms import LKPostalCodeFormField + + +class LKPostalCodeValidator(RegexValidator): + """ + A validator for Sri Lanka Postal Codes. + """ + default_error_messages = { + 'invalid': _('Enter a postal code in format XXXXX'), + } + + def __init__(self, *args, **kwargs): + super().__init__(re.compile(r'^\d{5}$'), *args, **kwargs) + + +class LKPostalCodeField(models.CharField): + """ + A model field that accepts Sri Lanka postal codes. + Format: XXXXX + Source: https://en.wikipedia.org/wiki/Postal_codes_in_Sri_Lanka + .. versionadded:: 4.0 + """ + description = _("Postal Code") + + def __init__(self, *args, **kwargs): + kwargs['max_length'] = 5 + super().__init__(*args, **kwargs) + self.validators.append(LKPostalCodeValidator()) + + def formfield(self, **kwargs): + defaults = {'form_class': LKPostalCodeFormField} + defaults.update(kwargs) + return super().formfield(**defaults) From eae7bc1a6d28777c8cb7a873da9f3d884de412f2 Mon Sep 17 00:00:00 2001 From: dishansa Date: Mon, 24 Jul 2023 15:22:13 +0530 Subject: [PATCH 09/20] add the LKDistrictField and LKProvinceField --- localflavor/lk/models.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/localflavor/lk/models.py b/localflavor/lk/models.py index 186e06fe..586f61ce 100644 --- a/localflavor/lk/models.py +++ b/localflavor/lk/models.py @@ -7,6 +7,8 @@ from django.utils.translation import gettext_lazy as _ from .forms import LKPostalCodeFormField +from .lk_districts import DISTRICTS +from .lk_provinces import PROVINCES class LKPostalCodeValidator(RegexValidator): @@ -39,3 +41,39 @@ def formfield(self, **kwargs): defaults = {'form_class': LKPostalCodeFormField} defaults.update(kwargs) return super().formfield(**defaults) + + +class LKDistrictField(models.CharField): + """ + A model field that provides an option to select + a district from the list of all Sri Lanka districts. + .. versionadded:: 4.0 + """ + + def __init__(self, *args, **kwargs): + kwargs['choices'] = DISTRICTS + kwargs['max_length'] = 15 + super().__init__(*args, **kwargs) + + def deconstruct(self): + name, path, args, kwargs = super().deconstruct() + del kwargs['choices'] + return name, path, args, kwargs + + +class LKProvinceField(models.CharField): + """ + A model field that provides an option to select + a province from the list of all Sri Lanka provinces. + .. versionadded:: 4.0 + """ + + def __init__(self, *args, **kwargs): + kwargs['choices'] = PROVINCES + kwargs['max_length'] = 15 + super().__init__(*args, **kwargs) + + def deconstruct(self): + name, path, args, kwargs = super().deconstruct() + del kwargs['choices'] + return name, path, args, kwargs From 67620a13111f76b3ef986c73fdd5f12d82fe2e66 Mon Sep 17 00:00:00 2001 From: dishansa Date: Mon, 24 Jul 2023 15:38:34 +0530 Subject: [PATCH 10/20] Fix spelling mistake in LKDistrictSelect --- localflavor/lk/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localflavor/lk/forms.py b/localflavor/lk/forms.py index 4f608176..bbbf6139 100644 --- a/localflavor/lk/forms.py +++ b/localflavor/lk/forms.py @@ -33,7 +33,7 @@ def __init__(self, attrs=None): super().__init__(attrs, choices=PROVINCES) -class LKDistrictsSelect(Select): +class LKDistrictSelect(Select): """ A Select widget with option to select a districts from list of all districts of Sri Lanka. From 8eea64f367fb4b59b8b41bf7096a022ab7b32499 Mon Sep 17 00:00:00 2001 From: dishansa Date: Mon, 24 Jul 2023 18:37:38 +0530 Subject: [PATCH 11/20] Add tests --- tests/test_lk/__init__.py | 0 tests/test_lk/models.py | 8 +++++ tests/test_lk/selectfields_html.py | 46 +++++++++++++++++++++++++++ tests/test_lk/tests.py | 50 ++++++++++++++++++++++++++++++ 4 files changed, 104 insertions(+) create mode 100644 tests/test_lk/__init__.py create mode 100644 tests/test_lk/models.py create mode 100644 tests/test_lk/selectfields_html.py create mode 100644 tests/test_lk/tests.py diff --git a/tests/test_lk/__init__.py b/tests/test_lk/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/test_lk/models.py b/tests/test_lk/models.py new file mode 100644 index 00000000..34117ab9 --- /dev/null +++ b/tests/test_lk/models.py @@ -0,0 +1,8 @@ +from django.db import models + +from localflavor.lk.models import (LKDistrictField, LKProvinceField) + + +class LKPlace(models.Model): + district = LKDistrictField(blank=True) + province = LKProvinceField(blank=True) diff --git a/tests/test_lk/selectfields_html.py b/tests/test_lk/selectfields_html.py new file mode 100644 index 00000000..0266f806 --- /dev/null +++ b/tests/test_lk/selectfields_html.py @@ -0,0 +1,46 @@ +"""Option for all select box fields""" + +districts_select = """ + +""" + +provinces_select = """ + +""" diff --git a/tests/test_lk/tests.py b/tests/test_lk/tests.py new file mode 100644 index 00000000..37a32ef9 --- /dev/null +++ b/tests/test_lk/tests.py @@ -0,0 +1,50 @@ +from django.test import TransactionTestCase +from localflavor.lk.forms import LKDistrictSelect, LKPostalCodeFormField, LKProvinceSelect + +from .selectfields_html import districts_select, provinces_select +from .models import LKPlace + + +class SriLanakDetailsTests(TransactionTestCase): + """ + This Test class tests all the selectbox + fields and Postal Code Fields. + """ + + def test_LKDistrictSelect(self): + field = LKDistrictSelect() + self.assertHTMLEqual(field.render('district', 'kandy'), districts_select) + + def test_LKProvinceSelect(self): + field = LKProvinceSelect() + self.assertHTMLEqual(field.render('province', 'central'), provinces_select) + + def test_LKPostalCodeFieldTest(self): + error_format = ['Enter a postal code in format XXXXX'] + valid = { + '12345': '12345', + '00000': '00000', + '11111': '11111' + } + invalid = { + '12345_123': error_format, + '1234-123': error_format, + '-232': error_format, + 'abc_den': error_format, + '2345-': error_format, + } + self.assertFieldOutput(LKPostalCodeFormField, valid, invalid) + + def test_LKDistrictField(self): + place = LKPlace() + place.district = 'kandy' + place.clean_fields() + place.save() + self.assertEqual(place.get_district_display(), 'Kandy') + + def test_LKProvinceField(self): + place = LKPlace() + place.province = 'central' + place.clean_fields() + place.save() + self.assertEqual(place.get_province_display(), 'Central') From c8666d65b4079ea4962f766e335e146d1280a44d Mon Sep 17 00:00:00 2001 From: dishansa Date: Mon, 24 Jul 2023 18:39:14 +0530 Subject: [PATCH 12/20] Add my name in authors.rst --- docs/authors.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/authors.rst b/docs/authors.rst index 2ab2cfb2..c6a3aa2e 100644 --- a/docs/authors.rst +++ b/docs/authors.rst @@ -127,3 +127,4 @@ Authors * Vladimir Nani * Xabi Bello * Abhineet Tamrakar +* Dishan Sachin From 8044ca4784f73674ec3fd338d503ca30c1368e85 Mon Sep 17 00:00:00 2001 From: dishansa Date: Mon, 24 Jul 2023 19:04:03 +0530 Subject: [PATCH 13/20] Init and update the lk.rst --- docs/localflavor/lk.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 docs/localflavor/lk.rst diff --git a/docs/localflavor/lk.rst b/docs/localflavor/lk.rst new file mode 100644 index 00000000..648e7d4f --- /dev/null +++ b/docs/localflavor/lk.rst @@ -0,0 +1,19 @@ +Sri Lanka (``lk``) +============== + +Forms +----- + +.. automodule:: localflavor.lk.forms + :members: + +Models +------ + +.. automodule:: localflavor.lk.models + :members: + +Data +---- +.. autodata:: localflavor.lk.lk_provinces.PROVINCES +.. autodata:: localflavor.lk.lk_districts.DISTRICTS \ No newline at end of file From 0e816a101e812bc7e81fe775e359be24f529376f Mon Sep 17 00:00:00 2001 From: dishansa Date: Thu, 27 Jul 2023 23:07:30 +0530 Subject: [PATCH 14/20] register the test --- tests/settings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/settings.py b/tests/settings.py index 8cce7c1c..fcd29acc 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -21,6 +21,7 @@ 'tests.test_gh', 'tests.test_np', 'tests.test_ca', + 'tests.test_lk', 'tests.test_generic', ] From d9071cbee77b9802cc0fcbc83884b2c2f6bb2742 Mon Sep 17 00:00:00 2001 From: dishansa Date: Fri, 28 Jul 2023 00:43:45 +0530 Subject: [PATCH 15/20] update the changelog --- docs/changelog.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index b2811ada..d9745693 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -6,7 +6,8 @@ Changelog New flavors: -- None +- Sri Lanka LocalFlavor: Support for Sri Lanka added + (`gh-492 `_). New fields for existing flavors: From 53cc5ddc7d32bfa3d514a56be4e7559d22de83ed Mon Sep 17 00:00:00 2001 From: Dishan Sachin <134765302+dishansa@users.noreply.github.com> Date: Fri, 28 Jul 2023 10:09:56 +0530 Subject: [PATCH 16/20] Update changelog.rst --- docs/changelog.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index d9745693..0bd6d535 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -6,8 +6,7 @@ Changelog New flavors: -- Sri Lanka LocalFlavor: Support for Sri Lanka added - (`gh-492 `_). +- None New fields for existing flavors: @@ -28,6 +27,8 @@ Other changes: New flavors: +- Sri Lanka LocalFlavor: Support for Sri Lanka added + (`gh-492 `_). - Nepal LocalFlavor: Support for Nepal added (`gh-451 `_). - Belarus localflavor From f34ed82143931eabd17e79b8d1f2c7d1a3f04d97 Mon Sep 17 00:00:00 2001 From: Dishan Sachin <134765302+dishansa@users.noreply.github.com> Date: Fri, 28 Jul 2023 10:19:40 +0530 Subject: [PATCH 17/20] Update changelog.rst --- docs/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 0bd6d535..b75b69b4 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -28,7 +28,7 @@ Other changes: New flavors: - Sri Lanka LocalFlavor: Support for Sri Lanka added - (`gh-492 `_). + (`gh-492 `_). - Nepal LocalFlavor: Support for Nepal added (`gh-451 `_). - Belarus localflavor From 2cd0be6d1ee0569df1ae7b3d1791575473bc7aee Mon Sep 17 00:00:00 2001 From: Dishan Sachin <134765302+dishansa@users.noreply.github.com> Date: Fri, 28 Jul 2023 10:20:59 +0530 Subject: [PATCH 18/20] Update changelog.rst --- docs/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index b75b69b4..78ccbd4e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -28,7 +28,7 @@ Other changes: New flavors: - Sri Lanka LocalFlavor: Support for Sri Lanka added - (`gh-492 `_). + (`gh-493 `_). - Nepal LocalFlavor: Support for Nepal added (`gh-451 `_). - Belarus localflavor From d4cb14dac2327a114318305b08edcd2a3e667f78 Mon Sep 17 00:00:00 2001 From: Dishan Sachin <134765302+dishansa@users.noreply.github.com> Date: Fri, 28 Jul 2023 14:27:18 +0530 Subject: [PATCH 19/20] Update changelog.rst --- docs/changelog.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 78ccbd4e..077b3500 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -6,7 +6,8 @@ Changelog New flavors: -- None +- Sri Lanka LocalFlavor: Support for Sri Lanka added + (`gh-493 `_). New fields for existing flavors: From a60ccb0f9f81cf14e0dd328bb7e97a4291501b8f Mon Sep 17 00:00:00 2001 From: Dishan Sachin <134765302+dishansa@users.noreply.github.com> Date: Fri, 28 Jul 2023 14:28:21 +0530 Subject: [PATCH 20/20] Update changelog.rst --- docs/changelog.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 077b3500..79c3b630 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -28,8 +28,6 @@ Other changes: New flavors: -- Sri Lanka LocalFlavor: Support for Sri Lanka added - (`gh-493 `_). - Nepal LocalFlavor: Support for Nepal added (`gh-451 `_). - Belarus localflavor