From 229d21780cb2616b3474fac01533fa51a516bc07 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Thu, 24 Jan 2013 15:45:47 -0600 Subject: Reporting: Fix text size discrepancy in grid view Signed-off-by: Sol Jerome --- src/lib/Bcfg2/Reporting/templates/clients/index.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/lib/Bcfg2/Reporting') diff --git a/src/lib/Bcfg2/Reporting/templates/clients/index.html b/src/lib/Bcfg2/Reporting/templates/clients/index.html index 45ba20b86..d9c415c20 100644 --- a/src/lib/Bcfg2/Reporting/templates/clients/index.html +++ b/src/lib/Bcfg2/Reporting/templates/clients/index.html @@ -30,6 +30,9 @@ {% endif %} {% endfor %} -{% else %}

No client records are available.

+{% else %} +
+

No client records are available.

+
{% endif %} {% endblock %} -- cgit v1.2.3-1-g7c22 From 0fd4dae52f48363ddb67ee7cf96d157345b8db04 Mon Sep 17 00:00:00 2001 From: Tim Laszlo Date: Tue, 29 Jan 2013 10:33:01 -0600 Subject: Remove distinct from query. Sqlite has no support --- src/lib/Bcfg2/Reporting/views.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lib/Bcfg2/Reporting') diff --git a/src/lib/Bcfg2/Reporting/views.py b/src/lib/Bcfg2/Reporting/views.py index 8ab3f8e59..0341a18af 100644 --- a/src/lib/Bcfg2/Reporting/views.py +++ b/src/lib/Bcfg2/Reporting/views.py @@ -213,8 +213,11 @@ def entry_status(request, entry_type, pk, timestamp=None, **kwargs): # There is no good way to do this... items = [] - for it in cls.objects.filter(interaction__in=current_clients, name=item.name).distinct("id").select_related(): - items.append((it, it.interaction_set.filter(pk__in=current_clients).order_by('client__name').select_related('client'))) + seen = [] + for it in cls.objects.filter(interaction__in=current_clients, name=item.name).select_related(): + if it.pk not in seen: + items.append((it, it.interaction_set.filter(pk__in=current_clients).order_by('client__name').select_related('client'))) + seen.append(it.pk) return render_to_response('config_items/entry_status.html', {'entry': item, -- cgit v1.2.3-1-g7c22 From e276eef783134b7676921c3f7869cb258b26cd95 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Tue, 29 Jan 2013 10:43:55 -0600 Subject: Version bump to 1.3.0rc2 Signed-off-by: Sol Jerome --- src/lib/Bcfg2/Reporting/templates/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lib/Bcfg2/Reporting') diff --git a/src/lib/Bcfg2/Reporting/templates/base.html b/src/lib/Bcfg2/Reporting/templates/base.html index 1ec6b8c24..533dcc79e 100644 --- a/src/lib/Bcfg2/Reporting/templates/base.html +++ b/src/lib/Bcfg2/Reporting/templates/base.html @@ -88,7 +88,7 @@
-- cgit v1.2.3-1-g7c22 From 86f5e4cb5d4b9988fb67f6611f83a058267b203c Mon Sep 17 00:00:00 2001 From: Tim Laszlo Date: Wed, 30 Jan 2013 09:01:02 -0600 Subject: Batch adding entries to interactions for sqlite --- src/lib/Bcfg2/Reporting/Storage/DjangoORM.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/lib/Bcfg2/Reporting') diff --git a/src/lib/Bcfg2/Reporting/Storage/DjangoORM.py b/src/lib/Bcfg2/Reporting/Storage/DjangoORM.py index fb7af7465..bca4a9c1e 100644 --- a/src/lib/Bcfg2/Reporting/Storage/DjangoORM.py +++ b/src/lib/Bcfg2/Reporting/Storage/DjangoORM.py @@ -224,7 +224,11 @@ class DjangoORM(StorageBase): inter.extra_count = counter_fields[TYPE_EXTRA] inter.save() for entry_type in updates.keys(): - getattr(inter, entry_type).add(*updates[entry_type]) + # batch this for sqlite + i = 0 + while(i < len(updates[entry_type])): + getattr(inter, entry_type).add(*updates[entry_type][i:i+100]) + i += 100 # performance metrics for times in stats.findall('OpStamps'): -- cgit v1.2.3-1-g7c22 From c2ec71065a75adb05178547f4fd3431178a06500 Mon Sep 17 00:00:00 2001 From: Tim Laszlo Date: Wed, 30 Jan 2013 09:29:04 -0600 Subject: Batch deletes for sqlite --- src/lib/Bcfg2/Reporting/models.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/lib/Bcfg2/Reporting') diff --git a/src/lib/Bcfg2/Reporting/models.py b/src/lib/Bcfg2/Reporting/models.py index c7850f4af..ab2dc8418 100644 --- a/src/lib/Bcfg2/Reporting/models.py +++ b/src/lib/Bcfg2/Reporting/models.py @@ -392,7 +392,13 @@ class BaseEntry(models.Model): @classmethod def prune_orphans(cls): '''Remove unused entries''' - cls.objects.filter(interaction__isnull=True).delete() + # yeat another sqlite hack + cls_orphans = [x['id'] \ + for x in cls.objects.filter(interaction__isnull=True).values("id")] + i = 0 + while i < len(cls_orphans): + cls.objects.filter(id__in=cls_orphans[i:i+100]).delete() + i += 100 class SuccessEntry(BaseEntry): -- cgit v1.2.3-1-g7c22