# Country grouping

**URL:** https://discuss.tryton.org/t/country-grouping/5065
**Category:** Feature
**Created:** [March 9, 2022, 7:52am UTC](https://discuss.tryton.org/t/country-grouping/5065 "2022-03-09T07:52:36Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![maxx](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/maxx/32/2320_2.png) [@maxx](https://discuss.tryton.org/u/maxx)
#### Post date: [March 9, 2022, 9:51am UTC](https://discuss.tryton.org/t/country-grouping/5065/3 "2022-03-09T09:51:18Z")

</div>

> [@pokoli](#):
>
> Why is the country group code required/usefull for?

I saw that continents have a code ([List of sovereign states and dependent territories by continent (data file) - Wikipedia](https://en.wikipedia.org/wiki/List_of_sovereign_states_and_dependent_territories_by_continent_(data_file))). And maybe some group could have an abbreviation. So code could be called abbreviation ?

> [@pokoli](#):
>
> We need to add some `start_date` and `end_date` to the relation of countries of a group.  
> This allows some countries to leave a group on a given date (we had a recent example with Brexit).

Not sure is useful. We don’t predict the future. Brexit is an isolated case. Most of the time groups exists and there’s no validity date. I mean, a country will not leave a continent and also there’s no versioning on the group. (European community V1 with Great Britain, EC V2 without Great Britain). Seems easier to manage manually such cases (which, i think, are not so frequent). You don’t know if Belgium will leave NATO or if spain will join OPEC…

> [@pokoli](#):
>
> I think its interesting to give some defaults values. Could you give more info on how such module can be used to fill the data?

Some defaults values could be the continents and doing the association of countries on each continent. This could be done in a script like `import_countries` and with [python-restcountries · PyPI](https://pypi.org/project/python-restcountries/) which allows to get continents and the countries related. Some other regional blocs are also referenced on this API (European Union, Pacific Alliance, …)

> [@pokoli](#):
>
> Also I’m not sure if it’s worth having a separate module. I’m wondering if it won’t be better to just add the models on the `country` module and extend the `import_countries` module to fill such data. This way we will avoid having two separate script for loading the same data.

Would be easier. 🙂

---

_[View the full topic](https://discuss.tryton.org/t/country-grouping/5065)._
