add weight types to live stovk types

This commit is contained in:
2025-07-14 12:14:22 +03:30
parent a5ce81efe7
commit 1b5b85a663
3 changed files with 44 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ from apps.core.models import BaseModel
from apps.authorization.models import UserRelations
from apps.authentication.models import Organization
from django.contrib.postgres.fields import ArrayField
from apps.livestock.models import LiveStockType
from datetime import datetime
import jdatetime
@@ -428,7 +429,12 @@ class QuotaLivestockAllocation(BaseModel):
null=True
)
livestock_group = models.CharField(max_length=20, choices=LivestockGroup.choices, null=True)
livestock_type = models.CharField(max_length=20, choices=LivestockType.choices, null=True)
livestock_type = models.ForeignKey(
LiveStockType,
on_delete=models.CASCADE,
related_name='allocations',
null=True
)
livestock_subtype = models.CharField(max_length=20, choices=LivestockSubtype.choices, null=True)
quantity_kg = models.DecimalField(max_digits=12, decimal_places=2, null=True)