Commit 1860f06e authored by stef's avatar stef

[enh] only items verified or confirmed in ods

parent 496d707d
......@@ -5,6 +5,7 @@ os.environ['DJANGO_SETTINGS_MODULE'] = "nnmon.settings"
from django.conf import settings
from bt.models import Violation
from django.db.models import Count
import ooolib
from django.utils.html import strip_tags
import re, htmlentitydefs
......@@ -63,7 +64,8 @@ def save_ods():
doc.set_cell_property('bold', False)
row=3
for v in Violation.objects.filter(activationid='').exclude(state__in=['closed', 'ooscope', 'duplicate']):
for v in Violation.objects.filter(activationid='').exclude(state__in=['closed', 'ooscope', 'duplicate']).annotate(total=Count('confirmation')):
if v.total>0 or v.state=='verified':
doc.set_row_property(row, 'height', '16.5pt')
doc.set_cell_property('wrap-option', 'wrap')
doc.set_cell_value(1, row, "string", v.country)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment