Skip to content

Commit 4d2c0bc

Browse files
committed
Rename API country field name_engl to name_en
1 parent 9095a17 commit 4d2c0bc

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

api/serializers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ class Meta:
4646
class CountrySerializer(serializers.ModelSerializer):
4747
class Meta:
4848
model = EuropeCountry
49-
fields = ("id", "name_engl", "iso3_code")
49+
fields = ("id", "name_en", "iso3_code")
5050
extra_kwargs = {
5151
"id": {"source": "gid"},
52+
"name_en": {"source": "name_engl"}
5253
}
5354

5455

api/tests/integration/countries/schema.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ variables:
77
endpoint: "countries"
88
response_data_validation:
99
id: !anyint
10-
name_engl: !anystr
10+
name_en: !anystr
1111
iso3_code: !anystr
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Generated by Django 2.2.7 on 2024-10-31 08:36
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('tigaserver_app', '0056_photo_uuid_uuidfield'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='europecountry',
15+
name='iso3_code',
16+
field=models.CharField(help_text='ISO 3166-1 alpha-3 country code (3-letter code, e.g., ESP).', max_length=3),
17+
),
18+
migrations.AlterField(
19+
model_name='europecountry',
20+
name='name_engl',
21+
field=models.CharField(help_text='Full name of the country in English (e.g., Spain).', max_length=44),
22+
),
23+
]

tigaserver_app/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,8 @@ class MissionItem(models.Model):
442442
class EuropeCountry(models.Model):
443443
gid = models.AutoField(primary_key=True)
444444
cntr_id = models.CharField(max_length=2, blank=True)
445-
name_engl = models.CharField(max_length=44, blank=True)
446-
iso3_code = models.CharField(max_length=3, blank=True)
445+
name_engl = models.CharField(max_length=44, help_text='Full name of the country in English (e.g., Spain).')
446+
iso3_code = models.CharField(max_length=3, help_text='ISO 3166-1 alpha-3 country code (3-letter code, e.g., ESP).')
447447
fid = models.CharField(max_length=2, blank=True)
448448
geom = models.MultiPolygonField(blank=True, null=True)
449449
x_min = models.FloatField(blank=True, null=True)

0 commit comments

Comments
 (0)