Skip to content

Commit

Permalink
Allow more diverse parent segment pointer types
Browse files Browse the repository at this point in the history
  • Loading branch information
ToucheSir committed Dec 1, 2020
1 parent e723d58 commit c75b3a4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions backend/app/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from datetime import datetime
from typing import List, Optional, Any, Mapping
from pydantic import BaseModel, BaseConfig, Field, SecretStr
from typing import Any, List, Mapping, Optional, Union
from uuid import UUID

from bson import ObjectId
from pydantic import BaseConfig, BaseModel, Field, SecretStr


class HasId(BaseModel):
Expand Down Expand Up @@ -48,9 +50,9 @@ class Config:

class SegmentRecord(HasId):
case_id: str
# Points to annotation_pool collection
pool_segment: ObjectId
# If ObjectId, points to annotation_pool collection
pool_segment: Union[ObjectId, UUID, str]

start_idx: int
stop_idx: int
zero_padded: bool
Expand Down

0 comments on commit c75b3a4

Please sign in to comment.