aboutsummaryrefslogtreecommitdiffstats
path: root/layerindex/restviews.py
diff options
context:
space:
mode:
authorLiam R. Howlett <Liam.Howlett@WindRiver.com>2016-10-04 14:00:20 -0400
committerPaul Eggleton <paul.eggleton@linux.intel.com>2016-10-18 16:42:15 +1300
commit31c85196d05392726afaed622b46b13210e5912b (patch)
tree5cc4f950ff2f41f535f7eceef913765c1221c12c /layerindex/restviews.py
parent4f0be8a7d03124aa834431e301a2f54abf05cd61 (diff)
downloadopenembedded-core-contrib-31c85196d05392726afaed622b46b13210e5912b.tar.gz
layerindex: Add distro to web interface and model
Add the distros to the index. This looks a lot like the machines and allows users to search for a particular distro. Signed-off-by: Liam R. Howlett <Liam.Howlett@WindRiver.com> Added associated migration. Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Diffstat (limited to 'layerindex/restviews.py')
-rw-r--r--layerindex/restviews.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/layerindex/restviews.py b/layerindex/restviews.py
index b33d3d19d7..57f1552a78 100644
--- a/layerindex/restviews.py
+++ b/layerindex/restviews.py
@@ -1,4 +1,4 @@
-from layerindex.models import Branch, LayerItem, LayerNote, LayerBranch, LayerDependency, Recipe, Machine
+from layerindex.models import Branch, LayerItem, LayerNote, LayerBranch, LayerDependency, Recipe, Machine, Distro
from rest_framework import viewsets, serializers
from layerindex.querysethelper import params_to_queryset, get_search_tuple
@@ -56,3 +56,11 @@ class MachineSerializer(serializers.ModelSerializer):
class MachineViewSet(ParametricSearchableModelViewSet):
queryset = Machine.objects.all()
serializer_class = MachineSerializer
+
+class DistroSerializer(serializers.ModelSerializer):
+ class Meta:
+ model = Distro
+
+class DistroViewSet(ParametricSearchableModelViewSet):
+ queryset = Distro.objects.all()
+ serializer_class = DistroSerializer