livestock type in quota limitations

This commit is contained in:
2025-07-14 13:40:16 +03:30
parent 1b5b85a663
commit 2d31a64e3b
3 changed files with 43 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
# Generated by Django 5.0 on 2025-07-14 09:01
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('product', '0045_quotalivestockallocation_livestock_type'),
]
operations = [
migrations.RemoveField(
model_name='quotalivestockagelimitation',
name='livestock_type',
),
]

View File

@@ -0,0 +1,20 @@
# Generated by Django 5.0 on 2025-07-14 09:04
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('livestock', '0012_livestocktype_weight_type'),
('product', '0046_remove_quotalivestockagelimitation_livestock_type'),
]
operations = [
migrations.AddField(
model_name='quotalivestockagelimitation',
name='livestock_type',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='quota_limitations', to='livestock.livestocktype'),
),
]

View File

@@ -458,7 +458,12 @@ class QuotaLiveStockAgeLimitation(BaseModel):
related_name='livestock_age_limitations', related_name='livestock_age_limitations',
null=True 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='quota_limitations',
null=True
)
livestock_subtype = models.CharField(max_length=20, choices=LivestockSubtype.choices, null=True) livestock_subtype = models.CharField(max_length=20, choices=LivestockSubtype.choices, null=True)
age_month = models.PositiveIntegerField(default=0) age_month = models.PositiveIntegerField(default=0)