Энергия НК (Видимость участков)
This commit is contained in:
parent
f65ff60cb2
commit
e86fd02643
18
apps/geoproc/migrations/0025_sector_visible.py
Normal file
18
apps/geoproc/migrations/0025_sector_visible.py
Normal file
@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.2.25 on 2025-02-26 02:46
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('geoproc', '0024_auto_20250224_0906'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='sector',
|
||||
name='visible',
|
||||
field=models.BooleanField(default=True),
|
||||
),
|
||||
]
|
||||
@ -3,6 +3,7 @@ from django.db import models
|
||||
|
||||
class Sector(models.Model):
|
||||
name = models.CharField(max_length=255, verbose_name="Наименование")
|
||||
visible = models.BooleanField(default=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
@ -15,7 +15,7 @@ from sabron.util import logging
|
||||
def sector_main(request):
|
||||
try:
|
||||
context = generalmodule.get_context_template()
|
||||
sector_qs = Sector.objects.all()
|
||||
sector_qs = Sector.objects.filter(visible=True)
|
||||
context['sectors'] = sector_qs
|
||||
return render(request, "sector_list.html", context)
|
||||
except Exception:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user