Commit 10293956 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

expose ordered projects

parent 27f26e29
Pipeline #5524 passed with stage
in 1 minute and 46 seconds
......@@ -1165,11 +1165,9 @@ def to_release_in_robotpkg():
def ordered_projects():
# TODO: clean, expose on API, add wip after current lst
bad_ones = Q(from_gepetto=False) | Q(robotpkg__isnull=True) | Q(robotpkg__category='wip')
library_bad_ones = (Q(library__from_gepetto=False)
| Q(library__robotpkg__isnull=True)
| Q(library__robotpkg__category='wip'))
""" helper for gepetto/buildfarm/generate_all.py """
bad_ones = Q(from_gepetto=False) | Q(robotpkg__isnull=True)
library_bad_ones = Q(library__from_gepetto=False) | Q(library__robotpkg__isnull=True)
main = Project.objects.exclude(bad_ones)
ret = main.all().exclude(dependencies__isnull=False)
......
......@@ -27,6 +27,7 @@ urlpatterns = [
path('contributors', views.ContributorsView.as_view(), name='contributors'),
path('projects', views.ProjectsView.as_view(), name='projects'),
path('projects/gepetto', views.GepettoProjectsView.as_view(), name='gepetto'),
path('projects/ordered', views.ordered_projects, name='ordered'),
path('project/<str:slug>/robotpkg', views.ProjectView.as_view(), name='project'),
path('project/<str:slug>/repos', views.ProjectReposView.as_view(), name='project-repos'),
path('project/<str:slug>/branches', views.ProjectBranchesView.as_view(), name='project-branches'),
......
......@@ -3,6 +3,7 @@ from subprocess import PIPE, run
from django.http import Http404
from django.http.response import HttpResponse, JsonResponse
from django.views.generic import DetailView
from django_filters.views import FilterView
from django_tables2 import RequestConfig
from django_tables2.views import SingleTableMixin, SingleTableView
......@@ -133,6 +134,10 @@ def graph_svg(request):
return HttpResponse(svg, content_type='image/svg+xml')
def ordered_projects(request):
return JsonResponse(models.order_projects)
class AuthenticatedOrReadOnlyModelViewSet(viewsets.ModelViewSet):
permission_classes = (permissions.IsAuthenticatedOrReadOnly, )
......
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