Skip to content

Commit 591291f

Browse files
authored
Merge pull request #368 from ohmg-dev/331_multimask_ct
331 multimask ct
2 parents 82d28b9 + 9abb277 commit 591291f

6 files changed

Lines changed: 27 additions & 1 deletion

File tree

ohmg/api/schemas.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class MapListSchema2(Schema):
9696
region_ct: int
9797
prepared_ct: int
9898
layer_ct: int
99+
main_layer_ct: int
99100
skip_ct: int
100101
nonmap_ct: int
101102
completion_pct: int

ohmg/core/admin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class MapAdmin(admin.ModelAdmin):
2323
"region_ct",
2424
"prepared_ct",
2525
"layer_ct",
26+
"main_layer_ct",
2627
"skip_ct",
2728
"nonmap_ct",
2829
"completion_pct",
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 4.2.27 on 2026-04-24 19:07
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('core', '0010_remove_layerset_multimask'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='map',
15+
name='main_layer_ct',
16+
field=models.IntegerField(default=0),
17+
),
18+
]

ohmg/core/models/map.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ class Meta:
150150
layer_ct = models.IntegerField(
151151
default=0,
152152
)
153+
main_layer_ct = models.IntegerField(
154+
default=0,
155+
)
153156
skip_ct = models.IntegerField(
154157
default=0,
155158
)
@@ -404,6 +407,7 @@ def update_item_lookup(self):
404407
self.region_ct = region_ct
405408
self.prepared_ct = prepared_ct
406409
self.layer_ct = layer_ct
410+
self.main_layer_ct = main_lyrs_ct
407411
self.skip_ct = skip_ct
408412
self.nonmap_ct = nonmap_ct
409413
self.completion_pct = completion_pct
@@ -418,6 +422,7 @@ def update_item_lookup(self):
418422
"region_ct",
419423
"prepared_ct",
420424
"layer_ct",
425+
"main_layer_ct",
421426
"skip_ct",
422427
"nonmap_ct",
423428
"completion_pct",

ohmg/core/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ def post(self, request):
475475
logger.debug(f"removing mask from layer {layer.slug} ({layer.pk})")
476476
layer.mask = None
477477
layer.save(set_extent=False, skip_map_lookup_update=True)
478+
layerset.map.update_item_lookup()
478479
return JsonResponseSuccess()
479480

480481

ohmg/frontend/svelte_components/src/components/tables/Maps.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@
249249
<td class="number-col">{s.skip_ct}</td>
250250
<td class="number-col">{s.nonmap_ct}</td>
251251
<td class="number-col new-col"><div class="box" style="--p:{s.completion_pct};"></div></td>
252-
<td class="number-col new-col">{s.multimask_ct}/{s.layer_ct}</td>
252+
<td class="number-col new-col">{s.multimask_ct}/{s.main_layer_ct}</td>
253253
<td class="number-col new-col"
254254
>{#if s.gt_exists}
255255
<span style="color:green">✓</span>

0 commit comments

Comments
 (0)