You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by gj...@apache.org on 2020/09/23 20:27:48 UTC
[bloodhound-core] 05/14: Complete adding django rest framework
example code
This is an automated email from the ASF dual-hosted git repository.
gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git
commit 73249fa33262a0a3cf53dd8481e51fe58f43bd2a
Author: Gary Martin <gj...@apache.org>
AuthorDate: Sun Oct 14 00:23:25 2018 +0000
Complete adding django rest framework example code
git-svn-id: https://svn.apache.org/repos/asf/bloodhound/branches/bh_core_experimental@1843802 13f79535-47bb-0310-9956-ffa450edef68
---
bh_core/settings.py | 1 +
trackers/urls.py | 1 +
trackers/views.py | 2 +-
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/bh_core/settings.py b/bh_core/settings.py
index 579b660..7482fd8 100644
--- a/bh_core/settings.py
+++ b/bh_core/settings.py
@@ -59,6 +59,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
+ 'rest_framework',
]
MIDDLEWARE = [
diff --git a/trackers/urls.py b/trackers/urls.py
index a7a1c75..7537b32 100644
--- a/trackers/urls.py
+++ b/trackers/urls.py
@@ -20,4 +20,5 @@ from . import views
urlpatterns = [
path('', views.home, name='home'),
+ path('ticket', views.TicketList.as_view()),
]
diff --git a/trackers/views.py b/trackers/views.py
index 3483c9f..64d3c34 100644
--- a/trackers/views.py
+++ b/trackers/views.py
@@ -27,6 +27,6 @@ from trackers.serializers import TicketSerializer
from trackers.models import Ticket
-class PlanetList(generics.ListCreateAPIView):
+class TicketList(generics.ListCreateAPIView):
queryset = Ticket.objects.all()
serializer_class = TicketSerializer