2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-09 15:10:54 +00:00

Simple supplier template

This commit is contained in:
Oliver Walters
2017-03-27 22:05:35 +11:00
parent ffcd56d5ba
commit abe0bbf2e4
5 changed files with 18 additions and 5 deletions

View File

@ -0,0 +1 @@
{{ supplier }}

View File

@ -3,5 +3,9 @@ from django.conf.urls import url
from . import views
urlpatterns = [
# Display details of a supplier
url(r'^(?P<supplier_id>[0-9]+)/$', views.supplierDetail, name='detail'),
url(r'^$', views.index, name='index')
]

View File

@ -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")
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})