first base of project-changed apps: Herd-livestock-tag-log-elasticsearch-

This commit is contained in:
2025-05-24 15:01:55 +03:30
parent eab40af15d
commit 90a46e493c
129 changed files with 3844 additions and 187 deletions

View File

@@ -4,9 +4,37 @@ from django.db import models
class Herd(BaseModel):
owner = models.ForeignKey(
auth_models.User,
on_delete=models.CASCADE,
related_name='herd',
null=True
)
cooperative = models.ForeignKey(
auth_models.Organization,
on_delete=models.CASCADE,
related_name='herd',
null=True
)
name = models.CharField(max_length=50)
photo = models.CharField(max_length=50, null=True)
code = models.CharField(max_length=20)
heavy_livestock_number = models.BigIntegerField(default=0)
light_livestock_number = models.BigIntegerField(default=0)
heavy_livestock_quota = models.BigIntegerField(default=0)
light_livestock_quota = models.BigIntegerField(default=0)
province = models.ForeignKey(
auth_models.Province,
on_delete=models.CASCADE,
related_name='herd_province',
null=True
)
city = models.ForeignKey(
auth_models.City,
on_delete=models.CASCADE,
related_name='herd_city',
null=True
)
postal = models.CharField(
max_length=10,
help_text="herd postal code", null=True