mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-09 15:10:54 +00:00
Updated Supplier URLs and API docs
This commit is contained in:
@ -1,12 +0,0 @@
|
||||
from django.conf.urls import url
|
||||
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
# Customer detail
|
||||
url(r'^(?P<pk>[0-9]+)/?$', views.CustomerDetail.as_view(), name='customer-detail'),
|
||||
|
||||
# List customers
|
||||
url(r'^\?.*/?$', views.CustomerList.as_view()),
|
||||
url(r'^$', views.CustomerList.as_view())
|
||||
]
|
@ -1,12 +0,0 @@
|
||||
from django.conf.urls import url
|
||||
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
# Manufacturer detail
|
||||
url(r'^(?P<pk>[0-9]+)/?$', views.ManufacturerDetail.as_view(), name='manufacturer-detail'),
|
||||
|
||||
# List manufacturers
|
||||
url(r'^\?.*/?$', views.ManufacturerList.as_view()),
|
||||
url(r'^$', views.ManufacturerList.as_view())
|
||||
]
|
@ -1,10 +0,0 @@
|
||||
from django.conf.urls import url
|
||||
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^(?P<pk>[0-9]+)/?$', views.SupplierPartDetail.as_view(), name='supplierpart-detail'),
|
||||
|
||||
url(r'^\?.*/?$', views.SupplierPartList.as_view()),
|
||||
url(r'^$', views.SupplierPartList.as_view())
|
||||
]
|
@ -1,10 +0,0 @@
|
||||
from django.conf.urls import url
|
||||
|
||||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^(?P<pk>[0-9]+)/?$', views.SupplierPriceBreakDetail.as_view(), name='supplierpricebreak-detail'),
|
||||
|
||||
url(r'^\?.*/?$', views.SupplierPriceBreakList.as_view()),
|
||||
url(r'^$', views.SupplierPriceBreakList.as_view())
|
||||
]
|
@ -2,14 +2,39 @@ from django.conf.urls import url
|
||||
|
||||
from . import views
|
||||
|
||||
pricepatterns = [
|
||||
cust_urls = [
|
||||
# Customer detail
|
||||
url(r'^(?P<pk>[0-9]+)/?$', views.CustomerDetail.as_view(), name='customer-detail'),
|
||||
|
||||
# List customers
|
||||
url(r'^\?.*/?$', views.CustomerList.as_view()),
|
||||
url(r'^$', views.CustomerList.as_view())
|
||||
]
|
||||
|
||||
manu_urls = [
|
||||
# Manufacturer detail
|
||||
url(r'^(?P<pk>[0-9]+)/?$', views.ManufacturerDetail.as_view(), name='manufacturer-detail'),
|
||||
|
||||
# List manufacturers
|
||||
url(r'^\?.*/?$', views.ManufacturerList.as_view()),
|
||||
url(r'^$', views.ManufacturerList.as_view())
|
||||
]
|
||||
|
||||
supplier_part_urls = [
|
||||
url(r'^(?P<pk>[0-9]+)/?$', views.SupplierPartDetail.as_view(), name='supplierpart-detail'),
|
||||
|
||||
url(r'^\?.*/?$', views.SupplierPartList.as_view()),
|
||||
url(r'^$', views.SupplierPartList.as_view())
|
||||
]
|
||||
|
||||
price_break_urls = [
|
||||
url(r'^(?P<pk>[0-9]+)/?$', views.SupplierPriceBreakDetail.as_view(), name='supplierpricebreak-detail'),
|
||||
|
||||
url(r'^\?.*/?$', views.SupplierPriceBreakList.as_view()),
|
||||
url(r'^$', views.SupplierPriceBreakList.as_view())
|
||||
]
|
||||
|
||||
urlpatterns = [
|
||||
supplier_urls = [
|
||||
|
||||
# Display details of a supplier
|
||||
url(r'^(?P<pk>[0-9]+)/$', views.SupplierDetail.as_view(), name='supplier-detail'),
|
||||
|
@ -13,6 +13,18 @@ from .serializers import CustomerSerializer
|
||||
|
||||
|
||||
class ManufacturerDetail(generics.RetrieveUpdateDestroyAPIView):
|
||||
"""
|
||||
|
||||
get:
|
||||
Return a single Manufacturer
|
||||
|
||||
post:
|
||||
Update a Manufacturer
|
||||
|
||||
delete:
|
||||
Remove a Manufacturer
|
||||
|
||||
"""
|
||||
|
||||
queryset = Manufacturer.objects.all()
|
||||
serializer_class = ManufacturerSerializer
|
||||
@ -20,6 +32,15 @@ class ManufacturerDetail(generics.RetrieveUpdateDestroyAPIView):
|
||||
|
||||
|
||||
class ManufacturerList(generics.ListCreateAPIView):
|
||||
"""
|
||||
|
||||
get:
|
||||
Return a list of all Manufacturers
|
||||
|
||||
post:
|
||||
Create a new Manufacturer
|
||||
|
||||
"""
|
||||
|
||||
queryset = Manufacturer.objects.all()
|
||||
serializer_class = ManufacturerSerializer
|
||||
@ -27,6 +48,18 @@ class ManufacturerList(generics.ListCreateAPIView):
|
||||
|
||||
|
||||
class CustomerDetail(generics.RetrieveUpdateDestroyAPIView):
|
||||
"""
|
||||
|
||||
get:
|
||||
Return a single Customer
|
||||
|
||||
post:
|
||||
Update a Customer
|
||||
|
||||
delete:
|
||||
Remove a Customer
|
||||
|
||||
"""
|
||||
|
||||
queryset = Customer.objects.all()
|
||||
serializer_class = CustomerSerializer
|
||||
@ -34,6 +67,15 @@ class CustomerDetail(generics.RetrieveUpdateDestroyAPIView):
|
||||
|
||||
|
||||
class CustomerList(generics.ListCreateAPIView):
|
||||
"""
|
||||
|
||||
get:
|
||||
Return a list of all Cutstomers
|
||||
|
||||
post:
|
||||
Create a new Customer
|
||||
|
||||
"""
|
||||
|
||||
queryset = Customer.objects.all()
|
||||
serializer_class = CustomerSerializer
|
||||
@ -41,6 +83,18 @@ class CustomerList(generics.ListCreateAPIView):
|
||||
|
||||
|
||||
class SupplierDetail(generics.RetrieveUpdateDestroyAPIView):
|
||||
"""
|
||||
|
||||
get:
|
||||
Return a single Supplier
|
||||
|
||||
post:
|
||||
Update a supplier
|
||||
|
||||
delete:
|
||||
Remove a supplier
|
||||
|
||||
"""
|
||||
|
||||
queryset = Supplier.objects.all()
|
||||
serializer_class = SupplierSerializer
|
||||
@ -48,6 +102,15 @@ class SupplierDetail(generics.RetrieveUpdateDestroyAPIView):
|
||||
|
||||
|
||||
class SupplierList(generics.ListCreateAPIView):
|
||||
"""
|
||||
|
||||
get:
|
||||
Return a list of all Suppliers
|
||||
|
||||
post:
|
||||
Create a new Supplier
|
||||
|
||||
"""
|
||||
|
||||
queryset = Supplier.objects.all()
|
||||
serializer_class = SupplierSerializer
|
||||
@ -55,6 +118,18 @@ class SupplierList(generics.ListCreateAPIView):
|
||||
|
||||
|
||||
class SupplierPartDetail(generics.RetrieveUpdateDestroyAPIView):
|
||||
"""
|
||||
|
||||
get:
|
||||
Return a single SupplierPart
|
||||
|
||||
post:
|
||||
Update a SupplierPart
|
||||
|
||||
delete:
|
||||
Remove a SupplierPart
|
||||
|
||||
"""
|
||||
|
||||
queryset = SupplierPart.objects.all()
|
||||
serializer_class = SupplierPartSerializer
|
||||
@ -75,6 +150,16 @@ class SupplierPartFilter(FilterSet):
|
||||
|
||||
|
||||
class SupplierPartList(generics.ListCreateAPIView):
|
||||
"""
|
||||
|
||||
get:
|
||||
List all SupplierParts
|
||||
(with optional query filters)
|
||||
|
||||
post:
|
||||
Create a new SupplierPart
|
||||
|
||||
"""
|
||||
|
||||
queryset = SupplierPart.objects.all()
|
||||
serializer_class = SupplierPartSerializer
|
||||
@ -85,6 +170,18 @@ class SupplierPartList(generics.ListCreateAPIView):
|
||||
|
||||
|
||||
class SupplierPriceBreakDetail(generics.RetrieveUpdateDestroyAPIView):
|
||||
"""
|
||||
|
||||
get:
|
||||
Return a single SupplierPriceBreak
|
||||
|
||||
post:
|
||||
Update a SupplierPriceBreak
|
||||
|
||||
delete:
|
||||
Remove a SupplierPriceBreak
|
||||
|
||||
"""
|
||||
|
||||
queryset = SupplierPriceBreak.objects.all()
|
||||
serializer_class = SupplierPriceBreakSerializer
|
||||
@ -101,6 +198,16 @@ class PriceBreakFilter(FilterSet):
|
||||
|
||||
|
||||
class SupplierPriceBreakList(generics.ListCreateAPIView):
|
||||
"""
|
||||
|
||||
get:
|
||||
Return a list of all SupplierPriceBreaks
|
||||
(with optional query filters)
|
||||
|
||||
post:
|
||||
Create a new SupplierPriceBreak
|
||||
|
||||
"""
|
||||
|
||||
queryset = SupplierPriceBreak.objects.all()
|
||||
serializer_class = SupplierPriceBreakSerializer
|
||||
|
Reference in New Issue
Block a user