Skip to content

Commit bc9dffe

Browse files
committed
fixup! feat(tool-picker): add necessary models
1 parent 79e4582 commit bc9dffe

File tree

4 files changed

+1
-71
lines changed

4 files changed

+1
-71
lines changed

apps/tool_picker/admin.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from .models import (
88
Catalog,
99
CheckboxOption,
10-
DisplayCategory,
1110
OrdinalTypeEnum,
1211
Question,
1312
QuestionTypeEnum,
@@ -417,8 +416,3 @@ class ToolFeatureAdmin(admin.ModelAdmin): # type: ignore[reportMissingTypeArgum
417416
list_display = ["name", "feature_category"]
418417
list_filter = ["feature_category"]
419418
search_fields = ["name"]
420-
421-
422-
@admin.register(DisplayCategory)
423-
class DisplayCategoryAdmin(admin.ModelAdmin): # type: ignore[reportMissingTypeArgument]
424-
list_display = ["title"]

apps/tool_picker/migrations/0003_displaycategory_toolfeature_tool_display_categories_and_more.py renamed to apps/tool_picker/migrations/0003_toolfeature_sector_tool_tool_sectors_and_more.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated by Django 5.2.9 on 2026-02-10 07:48
1+
# Generated by Django 5.2.9 on 2026-02-10 11:00
22

33
import apps.tool_picker.models
44
import django_choices_field.fields
@@ -14,14 +14,6 @@ class Migration(migrations.Migration):
1414
]
1515

1616
operations = [
17-
migrations.CreateModel(
18-
name='DisplayCategory',
19-
fields=[
20-
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
21-
('title', models.CharField(max_length=200)),
22-
('description', models.TextField(blank=True)),
23-
],
24-
),
2517
migrations.CreateModel(
2618
name='ToolFeature',
2719
fields=[
@@ -32,11 +24,6 @@ class Migration(migrations.Migration):
3224
('cash_RTM_code', models.CharField(max_length=40, null=True)),
3325
],
3426
),
35-
migrations.AddField(
36-
model_name='tool',
37-
name='display_categories',
38-
field=models.ManyToManyField(blank=True, related_name='tool_display_categories', to='tool_picker.displaycategory'),
39-
),
4027
migrations.CreateModel(
4128
name='Sector',
4229
fields=[

apps/tool_picker/models.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,6 @@ def __str__(self):
2929
return self.name
3030

3131

32-
# TODO: Should we rename DisplayCategory to ToolCategory?
33-
34-
35-
class DisplayCategory(models.Model):
36-
"""Model representing tool category."""
37-
38-
title = models.CharField(max_length=200)
39-
description = models.TextField(blank=True)
40-
41-
class Meta:
42-
verbose_name = "DisplayCategory"
43-
verbose_name_plural = "DisplayCategories"
44-
45-
@typing.override
46-
def __str__(self):
47-
return self.title
48-
49-
5032
class ToolFeature(models.Model):
5133
"""Model representing a tool feature."""
5234

@@ -165,7 +147,6 @@ class Tool(UserResource):
165147
blank=True,
166148
)
167149
tool_sectors = models.ManyToManyField(Sector, related_name="tool_sectors", blank=True)
168-
display_categories = models.ManyToManyField(DisplayCategory, related_name="tool_display_categories", blank=True)
169150
tool_features = models.ManyToManyField(ToolFeature, related_name="tool_features", blank=True)
170151

171152
class Meta(UserResource.Meta):

seed-data/db_seed.json

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -582,22 +582,6 @@
582582
"cash_RTM_code": "05-FS02-01"
583583
}
584584
},
585-
{
586-
"model": "tool_picker.displaycategory",
587-
"pk": 1,
588-
"fields": {
589-
"title": "All Tools",
590-
"description": "Some possible description here maybe for the card heading 'All Tools'"
591-
}
592-
},
593-
{
594-
"model": "tool_picker.displaycategory",
595-
"pk": 2,
596-
"fields": {
597-
"title": "Relief Data Management",
598-
"description": "Some possible description here maybe for the card heading 'Relief Data Management'"
599-
}
600-
},
601585
{
602586
"model": "tool_picker.question",
603587
"pk": 1,
@@ -878,10 +862,6 @@
878862
46,
879863
47,
880864
48
881-
],
882-
"display_categories": [
883-
1,
884-
2
885865
]
886866
}
887867
},
@@ -945,10 +925,6 @@
945925
46,
946926
47,
947927
48
948-
],
949-
"display_categories": [
950-
1,
951-
2
952928
]
953929
}
954930
},
@@ -1012,10 +988,6 @@
1012988
46,
1013989
47,
1014990
48
1015-
],
1016-
"display_categories": [
1017-
1,
1018-
2
1019991
]
1020992
}
1021993
},
@@ -1079,10 +1051,6 @@
10791051
46,
10801052
47,
10811053
48
1082-
],
1083-
"display_categories": [
1084-
1,
1085-
2
10861054
]
10871055
}
10881056
},

0 commit comments

Comments
 (0)