Skip to content

Commit dadf90c

Browse files
committed
1 parent 7abec62 commit dadf90c

File tree

4 files changed

+36
-3
lines changed

4 files changed

+36
-3
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 4.2.16 on 2026-02-11 14:46
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('map_projects', '0026_remove_mapproject_batch_size_and_more'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='mapproject',
15+
name='lookup_config',
16+
field=models.JSONField(blank=True, default=dict, null=True),
17+
),
18+
]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Generated by Django 4.2.16 on 2026-02-11 14:47
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('map_projects', '0027_mapproject_lookup_config'),
10+
]
11+
12+
operations = [
13+
]

core/map_projects/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class MapProject(BaseModel):
3636
score_configuration = models.JSONField(default=default_score_configuration, null=True, blank=True)
3737
filters = models.JSONField(default=dict, null=True, blank=True)
3838
candidates = models.JSONField(default=dict, null=True, blank=True)
39+
lookup_config = models.JSONField(default=dict, null=True, blank=True)
3940

4041
class Meta:
4142
db_table = 'map_projects'
@@ -166,6 +167,7 @@ def format_request_data(cls, data, parent_resource=None):
166167
cls.format_json(new_data, 'filters')
167168
cls.format_json(new_data, 'candidates')
168169
cls.format_json(new_data, 'algorithms')
170+
cls.format_json(new_data, 'lookup_config')
169171

170172
if parent_resource:
171173
new_data[parent_resource.resource_type.lower() + '_id'] = parent_resource.id

core/map_projects/serializers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Meta:
2222
'created_by', 'updated_by', 'created_at', 'updated_at', 'url', 'is_active',
2323
'public_access', 'file', 'user_id', 'organization_id', 'description',
2424
'target_repo_url', 'include_retired', 'score_configuration',
25-
'filters', 'candidates', 'algorithms'
25+
'filters', 'candidates', 'algorithms', 'lookup_config'
2626
]
2727

2828
def prepare_object(self, validated_data, instance=None, file=None):
@@ -36,7 +36,7 @@ def prepare_object(self, validated_data, instance=None, file=None):
3636
instance.columns = columns
3737
for attr in [
3838
'name', 'description', 'extras', 'target_repo_url', 'include_retired',
39-
'score_configuration', 'filters', 'candidates', 'algorithms'
39+
'score_configuration', 'filters', 'candidates', 'algorithms', 'lookup_config'
4040
]:
4141
setattr(instance, attr, validated_data.get(attr, get(instance, attr)))
4242
if not instance.id:
@@ -109,7 +109,7 @@ class Meta:
109109
'created_by', 'updated_by', 'created_at', 'updated_at', 'url', 'is_active',
110110
'owner', 'owner_type', 'owner_url', 'public_access',
111111
'target_repo_url', 'summary', 'logs', 'include_retired',
112-
'score_configuration', 'filters', 'candidates', 'algorithms'
112+
'score_configuration', 'filters', 'candidates', 'algorithms', 'lookup_config'
113113
]
114114

115115
def __init__(self, *args, **kwargs):

0 commit comments

Comments
 (0)