-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from scieloorg/set_country
Set country
- Loading branch information
Showing
16 changed files
with
455 additions
and
21 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
scholarly_articles/migrations/0007_affiliations_country.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 3.2.12 on 2022-10-25 16:51 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('scholarly_articles', '0006_rawunpaywall_scholarly_a_is_para_720cbd_idx'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='affiliations', | ||
name='country', | ||
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Country'), | ||
), | ||
] |
20 changes: 20 additions & 0 deletions
20
scholarly_articles/migrations/0008_alter_affiliations_country.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generated by Django 3.2.12 on 2022-10-26 13:20 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('usefulmodels', '0006_auto_20221026_1320'), | ||
('scholarly_articles', '0007_affiliations_country'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='affiliations', | ||
name='country', | ||
field=models.ForeignKey(blank=True, max_length=255, null=True, on_delete=django.db.models.deletion.SET_NULL, to='usefulmodels.country', verbose_name='Country'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from django.db.models import Q | ||
|
||
from scholarly_articles import models | ||
from usefulmodels.models import Country | ||
|
||
|
||
def run(): | ||
for country in Country.objects.all(): | ||
for aff in models.Affiliations.objects.filter( | ||
Q(name__icontains=country.name_en) | Q(name__icontains=country.name_pt), | ||
country__isnull=True, official__isnull=True).iterator(): | ||
aff.country = country | ||
aff.save() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
País (pt);País (en);Capital;Código ISO (3 letras);Código ISO (2 letras) | ||
Afeganistão;Afghanistan;Cabul;AFG;AF | ||
África do Sul;South Africa;Pretória;ZAF;ZA | ||
Albânia;Albania;Tirana;ALB;AL | ||
Alemanha;Germany;Berlim;DEU;DE | ||
Andorra;Andorra;Andorra-a-Velha;AND;AD | ||
Angola;Angola;Luanda;AGO;AO | ||
Antiga e Barbuda;Old And Bearded;São João;ATG;AG | ||
Arábia Saudita;Saudi Arabia;Riade;SAU;SA | ||
Argélia;Algeria;Argel;DZA;DZ | ||
Argentina;Argentina;Buenos Aires;ARG;AR | ||
Arménia;Armenia;Erevã;ARM;AM | ||
Austrália;Australia;Camberra;AUS;AU | ||
Áustria;Austria;Viena;AUT;AT | ||
Azerbaijão;Azerbaijan;Bacu;AZE;AZ | ||
Bahamas;Bahamas;Nassau;BHS;BS | ||
Bangladexe;Bangladesh;Daca;BGD;BD | ||
Barbados;Barbados;Bridgetown;BRB;BB | ||
Barém;Bahrain;Manama;BHR;BH | ||
Bélgica;Belgium;Bruxelas;BEL;BE | ||
Belize;Belize;Belmopã;BLZ;BZ | ||
Benim;Benin;Porto Novo;BEN;BJ | ||
Bielorrússia;Belarus;Minsque;BLR;BY | ||
Bolívia;Bolivia;Sucre;BOL;BO | ||
Bósnia e Herzegovina;Bosnia And Herzegovina;Saraievo;BIH;BA | ||
Botsuana;Botswana;Gaborone;BWA;BW | ||
Brasil;Brazil;Brasília;BRA;BR | ||
Brunei;Brunei;Bandar Seri Begauã;BRN;BN | ||
Bulgária;Bulgaria;Sófia;BGR;BG | ||
Burquina Faso;Burkina Faso;Uagadugu;BFA;BF | ||
Burúndi;Burundi;Bujumbura;BDI;BI | ||
Butão;Bhutan;Timbu;BTN;BT | ||
Cabo Verde;Cape Green;Praia;CPV;CV | ||
Camarões;Cameroon;Iaundé;CMR;CM | ||
Camboja;Cambodia;Pnom Pene;KHM;KH | ||
Canadá;Canada;Otava;CAN;CA | ||
Catar;Qatar;Doa;QAT;QA | ||
Cazaquistão;Kazakhstan;Astana;KAZ;KZ | ||
Chade;Chad;Jamena;TCD;TD | ||
Chile;Chile;Santiago;CHL;CL | ||
China;China;Pequim;CHN;CN | ||
Chipre;Cyprus;Nicósia;CYP;CY | ||
Colômbia;Colombia;Bogotá;COL;CO | ||
Comores;Comoros;Moroni;COM;KM | ||
Congo-Brazzaville;Congo-Brazzaville;Brazavile;COG;CG | ||
Coreia do Norte;North Korea;Pionguiangue;PRK;KP | ||
Coreia do Sul;South Korea;Seul;KOR;KR | ||
Cosovo;Cosov;Pristina;-;- | ||
Costa do Marfim;Costa Do Marfim;Iamussucro;CIV;CI | ||
Costa Rica;Costa Rica;São José;CRI;CR | ||
Croácia;Croatia;Zagrebe;HRV;HR | ||
Cuaite;Cuaite;Cidade do Cuaite;KWT;KW | ||
Cuba;Cuba;Havana;CUB;CU | ||
Dinamarca;Denmark;Copenhaga;DNK;DK | ||
Dominica;Dominica;Roseau;DMA;DM | ||
Egito;Egypt;Cairo;EGY;EG | ||
Emirados Árabes Unidos;United Arab Emirates;Abu Dabi;ARE;AE | ||
Equador;Ecuador;Quito;ECU;EC | ||
Eritreia;Eritrea;Asmara;ERI;ER | ||
Eslováquia;Slovakia;Bratislava;SVK;SK | ||
Eslovénia;Slovenia;Liubliana;SVN;SI | ||
Espanha;Spain;Madrid;ESP;ES | ||
Essuatíni;Eswatini;Lobamba;SWZ;SZ | ||
Estado da Palestina;State Of Palestine;Jerusalém Oriental;PSE;PS | ||
Estados Unidos;United States;Washington D.C.;USA;US | ||
Estónia;Estonia;Talim;EST;EE | ||
Etiópia;Ethiopia;Adis Abeba;ETH;ET | ||
Fiji;Fiji;Suva;FJI;FJ | ||
Filipinas;Philippines;Manila;PHL;PH | ||
Finlândia;Finland;Helsínquia;FIN;FI | ||
França;France;Paris;FRA;FR | ||
Gabão;Gabon;Libreville;GAB;GA | ||
Gâmbia;Gambia;Banjul;GMB;GM | ||
Gana;Ghana;Acra;GHA;GH | ||
Geórgia;Georgia;Tebilíssi;GEO;GE | ||
Granada;Grenade;São Jorge;GRD;GD | ||
Grécia;Greece;Atenas;GRC;GR | ||
Guatemala;Guatemala;Cidade da Guatemala;GTM;GT | ||
Guiana;Guyana;Georgetown;GUY;GY | ||
Guiné;Guinea;Conacri;GIN;GN | ||
Guiné Equatorial;Equatorial Guinea;Malabo;GNQ;GQ | ||
Guiné-Bissau;Guinea Bissau;Bissau;GNB;GW | ||
Haiti;Haiti;Porto Príncipe;HTI;HT | ||
Honduras;Honduras;Tegucigalpa;HND;HN | ||
Hungria;Hungary;Budapeste;HUN;HU | ||
Iémen;Yemen;Saná;YEM;YE | ||
Ilhas Marechal;Marshal Islands;Majuro;MHL;MH | ||
Índia;India;Nova Déli;IND;IN | ||
Indonésia;Indonesia;Jacarta;IDN;ID | ||
Irão;Iran;Teerão;IRN;IR | ||
Iraque;Iraq;Bagdade;IRQ;IQ | ||
Irlanda;Ireland;Dublim;IRL;IE | ||
Islândia;Iceland;Reiquiavique;ISL;IS | ||
Israel;Israel;Jerusalém;ISR;IL | ||
Itália;Italy;Roma;ITA;IT | ||
Jamaica;Jamaica;Kingston;JAM;JM | ||
Japão;Japan;Tóquio;JPN;JP | ||
Jibuti;Djibouti;Jibuti;DJI;DJ | ||
Jordânia;Jordan;Amã;JOR;JO | ||
Laus;Laus;Vienciana;LAO;LA | ||
Lesoto;Lesotho;Maseru;LSO;LS | ||
Letónia;Latvia;Riga;LVA;LV | ||
Líbano;Lebanon;Beirute;LBN;LB | ||
Libéria;Liberia;Monróvia;LBR;LR | ||
Líbia;Libya;Trípoli;LBY;LY | ||
Listenstaine;Liechtenstein;Vaduz;LIE;LI | ||
Lituânia;Lithuania;Vílnius;LTU;LT | ||
Luxemburgo;Luxembourg;Luxemburgo;LUX;LU | ||
Macedónia do Norte;North Macedonia;Escópia;MKD;MK | ||
Madagáscar;Madagascar;Antananarivo;MDG;MG | ||
Malásia;Malaysia;Cuala Lumpur;MYS;MY | ||
Maláui;Malawi;Lilôngue;MWI;MW | ||
Maldivas;Maldives;Malé;MDV;MV | ||
Mali;Mali;Bamaco;MLI;ML | ||
Malta;Malta;Valeta;MLT;MT | ||
Marrocos;Morocco;Rebate;MAR;MA | ||
Maurícia;Mauritius;Porto Luís;MUS;MU | ||
Mauritânia;Mauritania;Nuaquechote;MRT;MR | ||
México;Mexico;Cidade do México;MEX;MX | ||
Mianmar;Myanmar;Nepiedó;MMR;MM | ||
Micronésia;Micronesia;Paliquir;FSM;FM | ||
Moçambique;Mozambique;Maputo;MOZ;MZ | ||
Moldávia;Moldavia;Quixinau;MDA;MD | ||
Mónaco;Monaco;Mónaco;MCO;MC | ||
Mongólia;Mongolia;Ulã Bator;MNG;MN | ||
Montenegro;Montenegro;Podgoritsa;MNE;ME | ||
Namíbia;Namibia;Vinduque;NAM;NA | ||
Nauru;Nauru;Iarém;NRU;NR | ||
Nepal;Nepal;Catmandu;NPL;NP | ||
Nicarágua;Nicaragua;Manágua;NIC;NI | ||
Níger;Niger;Niamei;NER;NE | ||
Nigéria;Nigeria;Abuja;NGA;NG | ||
Noruega;Norway;Oslo;NOR;NO | ||
Nova Zelândia;New Zealand;Wellington;NZL;NZ | ||
Omã;Oman;Mascate;OMN;OM | ||
Países Baixos;Netherlands;Amesterdão;NLD;NL | ||
Palau;Palau;Ngerulmud;PLW;PW | ||
Panamá;Panama;Cidade do Panamá;PAN;PA | ||
Papua Nova Guiné;Papua New Guinea;Porto Moresby;PNG;PG | ||
Paquistão;Pakistan;Islamabade;PAK;PK | ||
Paraguai;Paraguay;Assunção;PRY;PY | ||
Peru;Peru;Lima;PER;PE | ||
Polónia;Poland;Varsóvia;POL;PL | ||
Portugal;Portugal;Lisboa;PRT;PT | ||
Quénia;Kenya;Nairóbi;KEN;KE | ||
Quirguistão;Kyrgyzstan;Bisqueque;KGZ;KG | ||
Quiribáti;Kiribati;Taraua do Sul;KIR;KI | ||
Reino Unido;Uk;Londres;GBR;GB | ||
República Centro-Africana;Central African Republic;Bangui;CAF;CF | ||
República Checa;Czech Republic;Praga;CZE;CZ | ||
República Democrática do Congo;Democratic Republic Of Congo;Quinxassa;COD;CD | ||
República Dominicana;Dominican Republic;São Domingos;DOM;DO | ||
Roménia;Romania;Bucareste;ROU;RO | ||
Ruanda;Rwanda;Quigali;RWA;RW | ||
Rússia;Russia;Moscovo;RUS;RU | ||
Salomão;Solomon;Honiara;SLB;SB | ||
Salvador;Savior;São Salvador;SLV;SV | ||
Samoa;Samoa;Apia;WSM;WS | ||
Santa Lúcia;Saint Lucia;Castries;LCA;LC | ||
São Cristóvão e Neves;Saint Kitts And Nevis;Basseterre;KNA;KN | ||
São Marinho;San Marino;São Marinho;SMR;SM | ||
São Tomé e Príncipe;Sao Tome And Principe;São Tomé;STP;ST | ||
São Vicente e Granadinas;Saint Vincent And The Grenadines;Kingstown;VCT;VC | ||
Seicheles;Seychelles;Vitória;SYC;SC | ||
Senegal;Senegal;Dacar;SEN;SN | ||
Serra Leoa;Sierra Leone;Freetown;SLE;SL | ||
Sérvia;Serbia;Belgrado;SRB;RS | ||
Singapura;Singapore;Singapura;SGP;SG | ||
Síria;Syria;Damasco;SYR;SY | ||
Somália;Somalia;Mogadíscio;SOM;SO | ||
Sri Lanca;Sri Lanka;Sri Jaiavardenapura-Cota;LKA;LK | ||
Sudão;Sudan;Cartum;SDN;SD | ||
Sudão do Sul;Southern Sudan;Juba;SSD;SS | ||
Suécia;Sweden;Estocolmo;SWE;SE | ||
Suíça;Switzerland;Berna;CHE;CH | ||
Suriname;Suriname;Paramaribo;SUR;SR | ||
Tailândia;Thailand;Banguecoque;THA;TH | ||
Taiuã;Taiwan;Taipé;TWN;TW | ||
Tajiquistão;Tajikistan;Duchambé;TJK;TJ | ||
Tanzânia;Tanzania;Dodoma;TZA;TZ | ||
Timor-Leste;East Timor;Díli;TLS;TL | ||
Togo;Togo;Lomé;TGO;TG | ||
Tonga;Tonga;Nucualofa;TON;TO | ||
Trindade e Tobago;Trinidad And Tobago;Porto de Espanha;TTO;TT | ||
Tunísia;Tunisia;Tunes;TUN;TN | ||
Turcomenistão;Turkmenistan;Asgabate;TKM;TM | ||
Turquia;Turkey;Ancara;TUR;TR | ||
Tuvalu;Tuvalu;Funafuti;TUV;TV | ||
Ucrânia;Ukraine;Quieve;UKR;UA | ||
Uganda;Uganda;Campala;UGA;UG | ||
Uruguai;Uruguay;Montevideu;URY;UY | ||
Usbequistão;Uzbekistan;Tasquente;UZB;UZ | ||
Vanuatu;Vanuatu;Porto Vila;VUT;VU | ||
Vaticano;Vatican;Vaticano;VAT;VA | ||
Venezuela;Venezuela;Caracas;VEN;VE | ||
Vietname;Vietnam;Hanói;VNM;VN | ||
Zâmbia;Zambia;Lusaca;ZMB;ZM | ||
Zimbábue;Zimbabwe;Harare;ZWE;ZW |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 3.2.12 on 2022-10-25 16:51 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('usefulmodels', '0004_alter_country_options'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='state', | ||
name='region', | ||
field=models.CharField(blank=True, choices=[('', ''), ('Norte', 'Norte'), ('Nordeste', 'Nordeste'), ('Centro-oeste', 'Centro-Oeste'), ('Sudeste', 'Sudeste'), ('Sul', 'Sul'), ('ALL', 'ALL'), ('NOT APPLICABLE', 'NOT_APPLICABLE'), ('UNDEFINED', 'UNDEFINED')], max_length=255, null=True, verbose_name='Região'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Generated by Django 3.2.12 on 2022-10-26 13:20 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('usefulmodels', '0005_alter_state_region'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='country', | ||
name='name', | ||
), | ||
migrations.AddField( | ||
model_name='country', | ||
name='name_en', | ||
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Name of the Country (en)'), | ||
), | ||
migrations.AddField( | ||
model_name='country', | ||
name='name_pt', | ||
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Name of the Country (pt)'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Generated by Django 3.2.12 on 2022-10-27 13:17 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('usefulmodels', '0006_auto_20221026_1320'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='country', | ||
name='acronym', | ||
), | ||
migrations.AddField( | ||
model_name='country', | ||
name='acron2', | ||
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Acronym to the Country (2 char)'), | ||
), | ||
migrations.AddField( | ||
model_name='country', | ||
name='acron3', | ||
field=models.CharField(blank=True, max_length=255, null=True, verbose_name='Acronym to the Country (3 char)'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 3.2.12 on 2022-10-27 14:24 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('usefulmodels', '0007_auto_20221027_1317'), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name='country', | ||
old_name='acron3', | ||
new_name='acronym', | ||
), | ||
migrations.RenameField( | ||
model_name='country', | ||
old_name='acron2', | ||
new_name='acronym2', | ||
), | ||
] |
Oops, something went wrong.