28 lines
734 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 django.contrib.gis.db import models
class StreetZone(models.Model):
"""
Модель зоны.
На карте на нем будет отображаться, сколько уличных тегов в ней находится.
"""
name = models.CharField(max_length=128)
polygon = models.PolygonField()
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",
]
),
]