Skip to content

Commit

Permalink
Add "starred" sampling method
Browse files Browse the repository at this point in the history
  • Loading branch information
mihow committed Nov 23, 2023
1 parent 18895fc commit 398a20a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions ami/main/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ class Meta:
"id",
"name",
"details",
"method",
]


Expand Down
1 change: 1 addition & 0 deletions ami/main/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ def star(self, _request, pk=None) -> Response:
collection, _created = SourceImageCollection.objects.get_or_create(
project=project,
name="Starred Images", # @TODO i18n and store this in constants
defaults={"method": "starred"},
)
collection.images.add(source_image)
return Response({"collection": collection.pk, "total_images": collection.images.count()})
Expand Down
1 change: 1 addition & 0 deletions ami/main/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1903,6 +1903,7 @@ def html(self) -> str:
"stratified_random",
"interval",
"manual",
"starred",
"random_from_each_event",
"last_and_random_from_each_event",
"greatest_file_size_from_each_event",
Expand Down

0 comments on commit 398a20a

Please sign in to comment.