Skip to content

Commit d8a98e8

Browse files
Add search_only and guide fields #10602
1 parent 136041a commit d8a98e8

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Generated by Django 4.2.10 on 2024-02-26 12:22
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
dependencies = [
8+
("models", "10553_lists_reffed_by_node_idx"),
9+
]
10+
11+
operations = [
12+
migrations.AddField(
13+
model_name="controlledlist",
14+
name="search_only",
15+
field=models.BooleanField(default=False),
16+
),
17+
migrations.AddField(
18+
model_name="controlledlistitem",
19+
name="guide",
20+
field=models.BooleanField(default=False),
21+
),
22+
]

arches/app/models/models.py

+2
Original file line numberDiff line numberDiff line change
@@ -1920,6 +1920,7 @@ class ControlledList(models.Model):
19201920
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
19211921
name = models.CharField(max_length=127, null=False)
19221922
dynamic = models.BooleanField(default=False)
1923+
search_only = models.BooleanField(default=False)
19231924

19241925
class Meta:
19251926
db_table = "controlled_lists"
@@ -1938,6 +1939,7 @@ class ControlledListItem(models.Model):
19381939
parent = models.ForeignKey(
19391940
"self", null=True, blank=True, on_delete=models.CASCADE, related_name="children"
19401941
)
1942+
guide = models.BooleanField(default=False)
19411943

19421944
class Meta:
19431945
db_table = "controlled_list_items"

arches/app/src/types/ControlledListManager.ts

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export type ControlledListItem = {
2020
id: string,
2121
uri: string,
2222
sortorder: number,
23+
guide: boolean,
2324
labels: Label[],
2425
children: ControlledListItem[],
2526
parent_id: string,
@@ -30,6 +31,7 @@ export type ControlledList = {
3031
id: string,
3132
name: string,
3233
dynamic: boolean,
34+
search_only: boolean,
3335
items: ControlledListItem[],
3436
nodes: ReferencingNode[],
3537
};

arches/app/views/controlled_lists.py

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def serialize(obj, depth_map=None, flat=False, nodes=False):
4949
"id": str(obj.id),
5050
"name": obj.name,
5151
"dynamic": obj.dynamic,
52+
"search_only": obj.search_only,
5253
"items": sorted(
5354
[
5455
serialize(item, depth_map, flat)
@@ -83,6 +84,7 @@ def serialize(obj, depth_map=None, flat=False, nodes=False):
8384
"id": str(obj.id),
8485
"uri": obj.uri,
8586
"sortorder": obj.sortorder,
87+
"guide": obj.guide,
8688
"labels": [serialize(label, depth_map) for label in obj.labels.all()],
8789
"parent_id": str(obj.parent_id) if obj.parent_id else None,
8890
"depth": depth_map[obj.id],
@@ -258,6 +260,7 @@ def post(self, request, **kwargs):
258260
return JSONErrorResponse(status=404)
259261

260262
clist.dynamic = data["dynamic"]
263+
clist.search_only = data["search_only"]
261264
clist.name = data["name"]
262265

263266
for item in data["items"]:

0 commit comments

Comments
 (0)