diff --git a/InvenTree/part/urls.py b/InvenTree/part/urls.py index 8102058781..db6550fba6 100644 --- a/InvenTree/part/urls.py +++ b/InvenTree/part/urls.py @@ -4,10 +4,10 @@ from . import views urlpatterns = [ # Display part detail - url(r'^(?P[0-9]+)/$', views.partdetail, name='detail'), + url(r'^(?P[0-9]+)/$', views.partDetail, name='detail'), # Display a list of top-level categories - url(r'^category/$', views.categorylist, name='categorylist'), + url(r'^category/$', views.categoryList, name='categorylist'), # Display a single part category url(r'^category/(?P[0-9]+)/$', views.category, name='category'), diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index c3371a4fac..3eb1446e6c 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -6,14 +6,14 @@ from .models import PartCategory, Part def index(request): return HttpResponse("Hello world. This is the parts page") -def partdetail(request, part_id): +def partDetail(request, part_id): part = get_object_or_404(Part, pk=part_id) return render(request, 'part/detail.html', {'part': part}) -def categorylist(request): +def categoryList(request): categories = PartCategory.objects.filter(parent = None) return render(request, 'part/categorylist.html', diff --git a/InvenTree/supplier/templates/supplier/detail.html b/InvenTree/supplier/templates/supplier/detail.html new file mode 100644 index 0000000000..709ba79248 --- /dev/null +++ b/InvenTree/supplier/templates/supplier/detail.html @@ -0,0 +1 @@ +{{ supplier }} \ No newline at end of file diff --git a/InvenTree/supplier/urls.py b/InvenTree/supplier/urls.py index 59e5d723c9..f382945b7f 100644 --- a/InvenTree/supplier/urls.py +++ b/InvenTree/supplier/urls.py @@ -3,5 +3,9 @@ from django.conf.urls import url from . import views urlpatterns = [ + + # Display details of a supplier + url(r'^(?P[0-9]+)/$', views.supplierDetail, name='detail'), + url(r'^$', views.index, name='index') ] \ No newline at end of file diff --git a/InvenTree/supplier/views.py b/InvenTree/supplier/views.py index 599496c891..2b0f00335f 100644 --- a/InvenTree/supplier/views.py +++ b/InvenTree/supplier/views.py @@ -1,5 +1,13 @@ from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse +from .models import Supplier + def index(request): - return HttpResponse("This is the suppliers page") \ No newline at end of file + return HttpResponse("This is the suppliers page") + +def supplierDetail(request, supplier_id): + supplier = get_object_or_404(Supplier, pk=supplier_id) + + return render(request, 'supplier/detail.html', + {'supplier': supplier}) \ No newline at end of file