6
0

result.py 790 B

12345678910111213141516171819202122232425262728293031323334353637
  1. from django.db import models
  2. from pycs_api.models import base
  3. from pycs_api.models.file import File
  4. from pycs_api.models.label import Label
  5. class Result(base.BaseModel):
  6. file = models.ForeignKey(
  7. File,
  8. on_delete=models.CASCADE
  9. )
  10. label = models.ForeignKey(
  11. Label,
  12. blank=True,
  13. null=True,
  14. on_delete=models.SET_NULL
  15. )
  16. type = models.CharField(
  17. max_length=32,
  18. choices=[
  19. ("labeled-image", "Image Label"),
  20. ("bounding-box", "Bounding Box"),
  21. ]
  22. )
  23. origin = models.CharField(
  24. max_length=32,
  25. choices=[
  26. ("manual", "Manual result"),
  27. ("computed", "Automatically generated result"),
  28. ]
  29. )
  30. data_encoded = models.TextField()