Skip to content

Commit bb43dd4

Browse files
committed
order usecases and datasets by recently modified
1 parent aaf509e commit bb43dd4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

api/types/type_collaborative.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def is_individual_collaborative(self) -> bool:
7676
def geographies(self) -> Optional[List[TypeGeo]]:
7777
"""Get geographies associated with this collaborative."""
7878
try:
79-
queryset = self.geographies.all() # type: ignore
79+
queryset = self.geographies.all().order_by("name") # type: ignore
8080
if not queryset.exists():
8181
return []
8282
return TypeGeo.from_django_list(queryset)
@@ -88,7 +88,7 @@ def datasets(self) -> Optional[List["TypeDataset"]]:
8888
"""Get datasets associated with this collaborative."""
8989
try:
9090
# Return raw Django objects and let Strawberry handle conversion
91-
queryset = self.datasets.all() # type: ignore
91+
queryset = self.datasets.all().order_by("modified") # type: ignore
9292
if not queryset.exists():
9393
return []
9494
return TypeDataset.from_django_list(queryset)
@@ -99,7 +99,7 @@ def datasets(self) -> Optional[List["TypeDataset"]]:
9999
def use_cases(self) -> Optional[List["TypeUseCase"]]:
100100
"""Get use cases associated with this collaborative."""
101101
try:
102-
queryset = self.use_cases.all() # type: ignore
102+
queryset = self.use_cases.all().order_by("modified") # type: ignore
103103
if not queryset.exists():
104104
return []
105105
return TypeUseCase.from_django_list(queryset)
@@ -141,7 +141,7 @@ def publishers(self) -> Optional[List["TypeOrganization"]]:
141141
def sectors(self) -> Optional[List["TypeSector"]]:
142142
"""Get sectors associated with this collaborative."""
143143
try:
144-
queryset = self.sectors.all() # type: ignore
144+
queryset = self.sectors.all().order_by("name") # type: ignore
145145
if not queryset.exists():
146146
return []
147147
return TypeSector.from_django_list(queryset)

0 commit comments

Comments
 (0)