Skip to content

Commit 08d4804

Browse files
committed
avoid 'latest' name collision
1 parent c76d227 commit 08d4804

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

share/models/ingest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def latest_by_suid_queryset(self, suid_queryset) -> models.QuerySet:
197197
.values('latest_rawdatum_id')
198198
))
199199

200-
def latest(self) -> models.QuerySet:
200+
def latest_for_each_suid(self) -> models.QuerySet:
201201
# only the latest datum for each described resource
202202
_latest_pk_subquery = models.Subquery(
203203
self.filter(suid_id=models.OuterRef('suid_id'))

trove/management/commands/migrate_rawdatum_expiration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def handle(self, *args, chunk_size: int, today: datetime.date, continue_after, *
2424
_before = time.perf_counter()
2525
_total_updated = 0
2626
_raw_qs = (
27-
share_db.RawDatum.objects.latest() # only the latest datum for each resource
27+
share_db.RawDatum.objects.latest_for_each_suid()
2828
.filter(expiration_date__gt=today) # ignore the expired (and the non-expiring)
2929
)
3030
if continue_after is not None:

0 commit comments

Comments
 (0)