mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Simple supplier template
This commit is contained in:
parent
ffcd56d5ba
commit
abe0bbf2e4
@ -4,10 +4,10 @@ from . import views
|
|||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
# Display part detail
|
# Display part detail
|
||||||
url(r'^(?P<part_id>[0-9]+)/$', views.partdetail, name='detail'),
|
url(r'^(?P<part_id>[0-9]+)/$', views.partDetail, name='detail'),
|
||||||
|
|
||||||
# Display a list of top-level categories
|
# 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
|
# Display a single part category
|
||||||
url(r'^category/(?P<category_id>[0-9]+)/$', views.category, name='category'),
|
url(r'^category/(?P<category_id>[0-9]+)/$', views.category, name='category'),
|
||||||
|
@ -6,14 +6,14 @@ from .models import PartCategory, Part
|
|||||||
def index(request):
|
def index(request):
|
||||||
return HttpResponse("Hello world. This is the parts page")
|
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)
|
part = get_object_or_404(Part, pk=part_id)
|
||||||
|
|
||||||
return render(request, 'part/detail.html',
|
return render(request, 'part/detail.html',
|
||||||
{'part': part})
|
{'part': part})
|
||||||
|
|
||||||
def categorylist(request):
|
def categoryList(request):
|
||||||
categories = PartCategory.objects.filter(parent = None)
|
categories = PartCategory.objects.filter(parent = None)
|
||||||
|
|
||||||
return render(request, 'part/categorylist.html',
|
return render(request, 'part/categorylist.html',
|
||||||
|
1
InvenTree/supplier/templates/supplier/detail.html
Normal file
1
InvenTree/supplier/templates/supplier/detail.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
{{ supplier }}
|
@ -3,5 +3,9 @@ from django.conf.urls import url
|
|||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
|
||||||
|
# Display details of a supplier
|
||||||
|
url(r'^(?P<supplier_id>[0-9]+)/$', views.supplierDetail, name='detail'),
|
||||||
|
|
||||||
url(r'^$', views.index, name='index')
|
url(r'^$', views.index, name='index')
|
||||||
]
|
]
|
@ -1,5 +1,13 @@
|
|||||||
from django.shortcuts import render, get_object_or_404
|
from django.shortcuts import render, get_object_or_404
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
|
|
||||||
|
from .models import Supplier
|
||||||
|
|
||||||
def index(request):
|
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})
|
Loading…
Reference in New Issue
Block a user