New Ticket

TICKET_CREATE privileges are required to perform this operation. You don't have the required permissions



Login Close

Changeset 31f1b1d


Ignore:
Timstamp:
Oct 14, 2018 12:23:26 AM (2 months ago)
Author:
Gary Martin <gjm@…>
Branches:
bh_core_experimental
Children:
e810572
Parents:
73249fa
Message:

Adds a basic ticket view and update api

git-svn-id: https://svn.apache.org/repos/asf/bloodhound/branches/bh_core_experimental@1843803 13f79535-47bb-0310-9956-ffa450edef68

Location:
trackers
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trackers/serializers.py

    rd3dc9d9 r31f1b1d  
    77        model = Ticket 
    88        fields = '__all__' 
     9 
     10class ChangeEventSerializer(serializers.ModelSerializer): 
     11    class Meta: 
     12        model = ChangeEvent 
     13        fields = '__all__' 
  • trackers/urls.py

    r73249fa r31f1b1d  
    2121urlpatterns = [ 
    2222    path('', views.home, name='home'), 
    23     path('ticket', views.TicketList.as_view()), 
     23    path('ticket/', views.TicketListCreate.as_view()), 
     24    path('ticket/<uuid:id>', views.TicketViewUpdate.as_view()), 
    2425] 
  • trackers/views.py

    r73249fa r31f1b1d  
    1919from django.shortcuts import render 
    2020from rest_framework import generics 
     21from trackers.serializers import TicketSerializer 
     22from trackers.models import Ticket 
    2123 
    2224def home(request): 
     
    2426 
    2527 
    26 from trackers.serializers import TicketSerializer 
    27 from trackers.models import Ticket 
     28class TicketListCreate(generics.ListCreateAPIView): 
     29    queryset = Ticket.objects.all() 
     30    serializer_class = TicketSerializer 
    2831 
    2932 
    30 class TicketList(generics.ListCreateAPIView): 
     33class TicketViewUpdate(generics.RetrieveUpdateAPIView): 
    3134    queryset = Ticket.objects.all() 
    3235    serializer_class = TicketSerializer 
     36    lookup_field = 'id' 
Note: See TracChangeset for help on using the changeset viewer.