Skip to content

Commit 29afcf8

Browse files
committed
use numeric ids for geographies
1 parent f653c23 commit 29afcf8

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

api/models/Geography.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import uuid
21
from typing import Optional
32

43
from django.db import models
@@ -7,7 +6,7 @@
76

87

98
class Geography(models.Model):
10-
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
9+
id = models.AutoField(primary_key=True)
1110
name = models.CharField(max_length=75, unique=True)
1211
code = models.CharField(
1312
max_length=100, null=True, blank=True, unique=False, default=""

api/schema/collaborative_schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class UpdateCollaborativeMetadataInput:
6767
tags: Optional[List[str]]
6868
sectors: List[uuid.UUID]
6969
sdgs: Optional[List[uuid.UUID]]
70-
geographies: Optional[List[uuid.UUID]]
70+
geographies: Optional[List[int]]
7171

7272

7373
@strawberry_django.partial(Collaborative, fields="__all__", exclude=["datasets"])
@@ -968,7 +968,7 @@ def update_collaborative_organization_relationships(
968968

969969

970970
def _update_collaborative_geographies(
971-
collaborative: Collaborative, geography_ids: List[uuid.UUID]
971+
collaborative: Collaborative, geography_ids: List[int]
972972
) -> None:
973973
"""Update geographies for a collaborative."""
974974
collaborative.geographies.clear()

0 commit comments

Comments
 (0)