Files
vontor-cz/backend/thirdparty/zasilkovna/models.py
2025-11-13 02:32:56 +01:00

18 lines
725 B
Python

from django.db import models
# Create your models here.
class Zasilkovna(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
packet_id = models.CharField(max_length=255, unique=True) # identifikátor od Packety
label_pdf = models.BinaryField(null=True, blank=True) # uložit PDF binárně nebo odkaz
status = models.CharField(max_length=50) # např. „created“, „in_transit“, „delivered“
cancelled = models.BooleanField(default=False)
metadata = models.JSONField(default=dict, blank=True) # pro případná extra data
def save(self, *args, **kwargs):
# případná logika před uložením
super().save(*args, **kwargs)