fix --> livestock species
This commit is contained in:
18
apps/livestock/migrations/0017_livestockspecies_value.py
Normal file
18
apps/livestock/migrations/0017_livestockspecies_value.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 5.0 on 2026-01-24 11:28
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('livestock', '0016_temporarylivestock'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='livestockspecies',
|
||||||
|
name='value',
|
||||||
|
field=models.IntegerField(default=0),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# Generated by Django 5.0 on 2026-01-24 11:32
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('livestock', '0017_livestockspecies_value'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='livestockspecies',
|
||||||
|
name='en_name',
|
||||||
|
field=models.CharField(max_length=50, null=True),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='livestockspecies',
|
||||||
|
name='name',
|
||||||
|
field=models.CharField(max_length=50, null=True),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -7,7 +7,9 @@ from apps.tag import models as tag_models
|
|||||||
|
|
||||||
class LiveStockSpecies(BaseModel): # noqa
|
class LiveStockSpecies(BaseModel): # noqa
|
||||||
""" species of live stocks like Kurdi, Luri, etc """ # noqa
|
""" species of live stocks like Kurdi, Luri, etc """ # noqa
|
||||||
name = models.CharField(max_length=50)
|
name = models.CharField(max_length=50, null=True)
|
||||||
|
en_name = models.CharField(max_length=50, null=True)
|
||||||
|
value = models.IntegerField(default=0)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f'{self.name}'
|
return f'{self.name}'
|
||||||
|
|||||||
@@ -179,4 +179,11 @@ class TagDistributionService:
|
|||||||
remaining_tag_count=Sum('remaining_tag_count'),
|
remaining_tag_count=Sum('remaining_tag_count'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
distributions = TagDistribution.objects.filter(
|
||||||
|
Q(assigner_org=org) |
|
||||||
|
Q(assigned_org=org),
|
||||||
|
is_closed=is_closed,
|
||||||
|
)
|
||||||
|
|
||||||
|
print(distributions)
|
||||||
return data
|
return data
|
||||||
|
|||||||
@@ -9,6 +9,14 @@ from apps.tag.exceptions import TagException
|
|||||||
from apps.tag.models import Tag, TagBatch
|
from apps.tag.models import Tag, TagBatch
|
||||||
from apps.tag.tools import tag_code_serial_scanning
|
from apps.tag.tools import tag_code_serial_scanning
|
||||||
|
|
||||||
|
SPECIES_MAP = {
|
||||||
|
'cow': 1,
|
||||||
|
'buffalo': 2,
|
||||||
|
'camel': 3,
|
||||||
|
'sheep': 4,
|
||||||
|
'goat': 5,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class TagService:
|
class TagService:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user