from django.db import models from pycs_api.models import base from pycs_api.models.file import File from pycs_api.models.label import Label class Result(base.BaseModel): file = models.ForeignKey( File, on_delete=models.CASCADE ) label = models.ForeignKey( Label, blank=True, null=True, on_delete=models.SET_NULL ) type = models.CharField( max_length=32, choices=[ ("labeled-image", "Image Label"), ("bounding-box", "Bounding Box"), ] ) origin = models.CharField( max_length=32, choices=[ ("manual", "Manual result"), ("computed", "Automatically generated result"), ] ) data_encoded = models.TextField()