-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This enum is used for a field named `kind` in a resource located at `/api/lambda/function`, so it seems pretty clear that it should be named `FunctionKind`. (Or perhaps `LambdaFunctionKind`, but I omitted the "lambda" for consistency with views and serializers.) In addition to renaming, move it to `models`, so that it can be used by serializers. No such serializers currently exist, but I'd like to add them later. Turn it into a Django choice enum as well, so that `__str__` works out of the box.
- Loading branch information
Showing
2 changed files
with
22 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright (C) 2022 Intel Corporation | ||
# Copyright (C) 2022-2024 CVAT.ai Corporation | ||
# | ||
# SPDX-License-Identifier: MIT | ||
|
||
import django.db.models as models | ||
|
||
class FunctionKind(models.TextChoices): | ||
DETECTOR = "detector" | ||
INTERACTOR = "interactor" | ||
REID = "reid" | ||
TRACKER = "tracker" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters