Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-django-collectd-rest for 
openSUSE:Factory checked in at 2023-02-23 16:30:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-django-collectd-rest (Old)
 and      /work/SRC/openSUSE:Factory/.python-django-collectd-rest.new.1706 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-django-collectd-rest"

Thu Feb 23 16:30:44 2023 rev:6 rq:1067406 version:0.2.4

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python-django-collectd-rest/python-django-collectd-rest.changes
  2022-04-21 15:48:43.716320717 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-django-collectd-rest.new.1706/python-django-collectd-rest.changes
        2023-02-23 16:54:22.833474780 +0100
@@ -1,0 +2,6 @@
+Thu Feb 23 13:56:53 UTC 2023 - Dirk Müller <dmuel...@suse.com>
+
+- update to 0.2.4:
+  * use prefetch_related to decrease queries
+
+-------------------------------------------------------------------

Old:
----
  django-collectd-rest-0.2.3.tar.gz

New:
----
  django-collectd-rest-0.2.4.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-django-collectd-rest.spec ++++++
--- /var/tmp/diff_new_pack.iuLXhd/_old  2023-02-23 16:54:23.193476867 +0100
+++ /var/tmp/diff_new_pack.iuLXhd/_new  2023-02-23 16:54:23.197476891 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-django-collectd-rest
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -20,7 +20,7 @@
 %define skip_python2 1
 %define skip_python36 1
 Name:           python-django-collectd-rest
-Version:        0.2.3
+Version:        0.2.4
 Release:        0
 Summary:        A simple Django application to demonstrate RRD plots
 License:        BSD-2-Clause

++++++ django-collectd-rest-0.2.3.tar.gz -> django-collectd-rest-0.2.4.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django-collectd-rest-0.2.3/PKG-INFO 
new/django-collectd-rest-0.2.4/PKG-INFO
--- old/django-collectd-rest-0.2.3/PKG-INFO     2021-12-26 13:00:26.000000000 
+0100
+++ new/django-collectd-rest-0.2.4/PKG-INFO     2022-05-30 21:13:58.000000000 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: django-collectd-rest
-Version: 0.2.3
+Version: 0.2.4
 Summary: A simple Django application to demonstrate RRD plots generated by 
collectd or any other rrd data
 Home-page: https://github.com/matwey/django-collectd-rest
 Author: Matwey V. Kornilov
@@ -8,7 +8,7 @@
 License: BSD-2-Clause
 Description: # django-collectd-rest
         
-        [![Build 
Status](https://app.travis-ci.com/matwey/django-collectd-rest.svg?branch=master)](https://app.travis-ci.com/matwey/django-collectd-rest)
+        [![Build 
Status](https://github.com/matwey/django-collectd-rest/actions/workflows/django.yml/badge.svg)](https://github.com/matwey/django-collectd-rest/actions/workflows/django.yml)
         [![PyPI 
version](https://badge.fury.io/py/django-collectd-rest.svg)](https://badge.fury.io/py/django-collectd-rest)
         
         django-collectd-rest is a simple [Django] application to demonstrate 
RRD plots generated by [collectd] or any other [rrd] data. The application is 
built on top of [django-rest-framework] and provides REST API to access the 
plots.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django-collectd-rest-0.2.3/README.md 
new/django-collectd-rest-0.2.4/README.md
--- old/django-collectd-rest-0.2.3/README.md    2021-12-26 12:47:52.000000000 
+0100
+++ new/django-collectd-rest-0.2.4/README.md    2021-12-26 13:31:04.000000000 
+0100
@@ -1,6 +1,6 @@
 # django-collectd-rest
 
-[![Build 
Status](https://app.travis-ci.com/matwey/django-collectd-rest.svg?branch=master)](https://app.travis-ci.com/matwey/django-collectd-rest)
+[![Build 
Status](https://github.com/matwey/django-collectd-rest/actions/workflows/django.yml/badge.svg)](https://github.com/matwey/django-collectd-rest/actions/workflows/django.yml)
 [![PyPI 
version](https://badge.fury.io/py/django-collectd-rest.svg)](https://badge.fury.io/py/django-collectd-rest)
 
 django-collectd-rest is a simple [Django] application to demonstrate RRD plots 
generated by [collectd] or any other [rrd] data. The application is built on 
top of [django-rest-framework] and provides REST API to access the plots.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django-collectd-rest-0.2.3/collectd_rest/views.py 
new/django-collectd-rest-0.2.4/collectd_rest/views.py
--- old/django-collectd-rest-0.2.3/collectd_rest/views.py       2019-11-23 
18:54:03.000000000 +0100
+++ new/django-collectd-rest-0.2.4/collectd_rest/views.py       2022-05-30 
21:05:09.000000000 +0200
@@ -8,11 +8,11 @@
        lookup_field = 'name'
 
 class GraphGroupViewSet(viewsets.ModelViewSet):
-       queryset = models.GraphGroup.objects.all()
+       queryset = models.GraphGroup.objects.prefetch_related('graphs', 
'graphs__granularity')
        serializer_class = serializers.GraphGroupSerializer
        lookup_field = 'name'
 
 class GraphViewSet(viewsets.ModelViewSet):
-       queryset = models.Graph.objects.prefetch_related('granularity').all()
+       queryset = models.Graph.objects.select_related('granularity')
        serializer_class = serializers.GraphSerializer
        renderer_classes = api_settings.DEFAULT_RENDERER_CLASSES + 
[renderers.PNGRenderer, renderers.SVGRenderer, ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/django-collectd-rest-0.2.3/django_collectd_rest.egg-info/PKG-INFO 
new/django-collectd-rest-0.2.4/django_collectd_rest.egg-info/PKG-INFO
--- old/django-collectd-rest-0.2.3/django_collectd_rest.egg-info/PKG-INFO       
2021-12-26 13:00:26.000000000 +0100
+++ new/django-collectd-rest-0.2.4/django_collectd_rest.egg-info/PKG-INFO       
2022-05-30 21:13:58.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: django-collectd-rest
-Version: 0.2.3
+Version: 0.2.4
 Summary: A simple Django application to demonstrate RRD plots generated by 
collectd or any other rrd data
 Home-page: https://github.com/matwey/django-collectd-rest
 Author: Matwey V. Kornilov
@@ -8,7 +8,7 @@
 License: BSD-2-Clause
 Description: # django-collectd-rest
         
-        [![Build 
Status](https://app.travis-ci.com/matwey/django-collectd-rest.svg?branch=master)](https://app.travis-ci.com/matwey/django-collectd-rest)
+        [![Build 
Status](https://github.com/matwey/django-collectd-rest/actions/workflows/django.yml/badge.svg)](https://github.com/matwey/django-collectd-rest/actions/workflows/django.yml)
         [![PyPI 
version](https://badge.fury.io/py/django-collectd-rest.svg)](https://badge.fury.io/py/django-collectd-rest)
         
         django-collectd-rest is a simple [Django] application to demonstrate 
RRD plots generated by [collectd] or any other [rrd] data. The application is 
built on top of [django-rest-framework] and provides REST API to access the 
plots.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django-collectd-rest-0.2.3/setup.py 
new/django-collectd-rest-0.2.4/setup.py
--- old/django-collectd-rest-0.2.3/setup.py     2021-12-26 12:51:23.000000000 
+0100
+++ new/django-collectd-rest-0.2.4/setup.py     2022-05-30 21:13:09.000000000 
+0200
@@ -14,7 +14,7 @@
 
 setup(
        name='django-collectd-rest',
-       version='0.2.3',
+       version='0.2.4',
        packages=['collectd_rest', 'collectd_rest.migrations'],
        ext_modules=[rrd],
        include_package_data=True,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django-collectd-rest-0.2.3/tests/graph.py 
new/django-collectd-rest-0.2.4/tests/graph.py
--- old/django-collectd-rest-0.2.3/tests/graph.py       2019-11-23 
18:58:25.000000000 +0100
+++ new/django-collectd-rest-0.2.4/tests/graph.py       2022-05-30 
21:05:09.000000000 +0200
@@ -89,6 +89,17 @@
                self.assertEqual(graph.granularity, granularity)
                mock.assert_called_with(command, format)
 
+       def test_graph_detail1(self):
+               group = GraphGroup.objects.create(name="group1", title="Group 
1")
+               granularity = GraphGranularity.objects.get(name='default')
+               graph = Graph.objects.create(name="graph1", title="Graph 1", 
command="format", group=group, granularity=granularity)
+
+               url = reverse('graph-detail', args=[graph.id])
+               response = self.client.get(url)
+               self.assertEqual(response.status_code, status.HTTP_200_OK)
+               json = response.json()
+               self.assertEqual(json['id'], graph.id)
+
        @patch('collectd_rest.serializers.render')
        def test_graph_create_duplicates(self, mock):
                command = 'format'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/django-collectd-rest-0.2.3/tests/group.py 
new/django-collectd-rest-0.2.4/tests/group.py
--- old/django-collectd-rest-0.2.3/tests/group.py       2021-12-26 
12:54:53.000000000 +0100
+++ new/django-collectd-rest-0.2.4/tests/group.py       2022-05-30 
21:05:09.000000000 +0200
@@ -5,7 +5,7 @@
 from django.test import TestCase
 from rest_framework import status
 from rest_framework.test import APIClient
-from collectd_rest.models import Graph, GraphGroup
+from collectd_rest.models import Graph, GraphGroup, GraphGranularity
 
 class GraphGroupTest(TestCase):
        def setUp(self):
@@ -28,3 +28,13 @@
                response = self.client.post(url, {
                        'title': 'The Group'}, format='json')
                self.assertEqual(response.status_code, 
status.HTTP_400_BAD_REQUEST)
+       def test_group_list1(self):
+               group = GraphGroup.objects.create(name="group1", title="Group 
1")
+               granularity = GraphGranularity.objects.get(name='default')
+               graph = Graph.objects.create(name="graph1", title="Graph 1", 
command="format", group=group, granularity=granularity)
+
+               url = reverse('graphgroup-list')
+               response = self.client.get(url)
+               self.assertEqual(response.status_code, status.HTTP_200_OK)
+               json = response.json()
+               self.assertEqual(len(json), 1)

Reply via email to