2025-07-09 15:58:09 +07:00

30 lines
824 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from apps.eps.models.zone.model_zones import Zone
from django.contrib.gis.db import models
class Building(models.Model):
"""
Модель здания.
На карте на нем будет отображаться, сколько внутренних тегов в нем находится.
"""
name = models.CharField(max_length=128)
polygon = models.PolygonField()
zones = models.ManyToManyField(Zone, blank=True)
active = models.BooleanField(default=True)
def __str__(self) -> str:
return self.name
class Meta:
ordering = ["name"]
verbose_name = "здание"
verbose_name_plural = "здания"
indexes = [
models.Index(
fields=[
"name",
],
),
]