from django.db import models
import uuid

class people(models.Model):
    id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
    name = models.CharField(max_length=100)
    tolerance = models.DecimalField(max_digits=10, decimal_places=2)

class peopleEncodings(models.Model):
    id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
    person = models.ForeignKey(people, on_delete=models.CASCADE, related_name="encodings")
    encoding = models.BinaryField()  # Untuk menyimpan encoding wajah dalam bentuk bytes
    image_path = models.CharField(max_length=255, blank=True, null=True)  # Opsional, menyimpan path gambar
