first base of project-changed apps: Herd-livestock-tag-log-elasticsearch-
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user