summaryrefslogtreecommitdiff
path: root/chimere/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-09-28 10:18:55 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-09-28 10:18:55 +0200
commit1d1a786eedd6af35b70265bc39af395767e993f0 (patch)
tree37bb50f9e364cae3d4092f71cfc14e5acf0bc194 /chimere/models.py
parentc337f48a8bb2941e206d7504b66a3a4f7299d572 (diff)
downloadChimère-1d1a786eedd6af35b70265bc39af395767e993f0.tar.bz2
Chimère-1d1a786eedd6af35b70265bc39af395767e993f0.zip
Contextual category for search result
Diffstat (limited to 'chimere/models.py')
-rw-r--r--chimere/models.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/chimere/models.py b/chimere/models.py
index a052b66..5a8157f 100644
--- a/chimere/models.py
+++ b/chimere/models.py
@@ -914,7 +914,9 @@ class GeographicItem(models.Model):
'icon_offset_y': cat.icon.offset_y,
'icon_popup_offset_x': cat.icon.popup_offset_x,
'icon_popup_offset_y': cat.icon.popup_offset_y,
- 'category_name': cat.name}
+ 'category_name': cat.name,
+ 'category_id': cat.pk,
+ }
try:
categories_icons[item['categories__pk']].update(
{'icon_width': cat.icon.image.width,
@@ -971,7 +973,7 @@ class GeographicItem(models.Model):
value['properties']['extra_colors'].append(colors)
continue
if limit_to_categories and \
- item["categories__pk"] not in limit_to_categories:
+ item["categories__pk"] not in limit_to_categories:
continue
if start:
start -= 1
@@ -1249,7 +1251,9 @@ class Marker(GeographicItem):
'icon_offset_y': cat.icon.offset_y,
'icon_popup_offset_x': cat.icon.popup_offset_x,
'icon_popup_offset_y': cat.icon.popup_offset_y,
- 'category_name': cat.name})
+ 'category_name': cat.name,
+ 'category_id': cat.pk,
+ })
try:
items['properties'].update(
{'icon_width': cat.icon.image.width,