more api fixes

This commit is contained in:
Oliver Walters 2017-04-14 08:52:25 +10:00
parent e0f86db664
commit 2f3e29ab13
3 changed files with 6 additions and 3 deletions

View File

@ -7,6 +7,8 @@ from .serializers import ProjectPartSerializer
class ProjectDetail(generics.RetrieveUpdateAPIView):
""" Project details
"""
queryset = Project.objects.all()
serializer_class = ProjectSerializer
@ -25,7 +27,7 @@ class NewProjectCategory(generics.CreateAPIView):
"""
serializer_class = ProjectCategoryDetailSerializer
permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
class ProjectCategoryDetail(generics.RetrieveUpdateAPIView):

View File

@ -10,5 +10,6 @@ urlpatterns = [
url(r'^location/(?P<pk>[0-9]+)$', views.LocationDetail.as_view()),
# List all top-level locations
url(r'^location/$', views.LocationList.as_view())
url(r'^location/$', views.LocationList.as_view()),
url(r'^$', views.LocationList.as_view())
]

View File

@ -5,7 +5,7 @@ from .models import StockLocation, StockItem
from .serializers import StockItemSerializer, LocationDetailSerializer
class PartStockDetail(generics.ListAPIView):
class PartStockDetail(generics.ListCreateAPIView):
""" Return a list of all stockitems for a given part
"""