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

pepe is a racist meme

This commit is contained in:
Oliver Walters
2017-03-28 23:21:26 +11:00
parent 9aebdab1c2
commit a5009147c3
6 changed files with 18 additions and 14 deletions

View File

@ -34,6 +34,7 @@ class SupplierPart(models.Model):
description = models.CharField(max_length=250,
blank=True)
def __str__(self):
return "{mpn} - {supplier}".format(
mpn = self.MPN,
@ -53,9 +54,10 @@ class SupplierPriceBreak(models.Model):
currency = models.CharField(max_length=10,
blank=True)
def __str__(self):
return "{mpn} - {cost}{currency} @ {quan}".format(
mpn=part.MPN,
cost=self.cost,
currency=self.currency if self.currency else '',
quan=self.quantity)
quan=self.quantity)

View File

@ -8,4 +8,4 @@ urlpatterns = [
url(r'^(?P<supplier_id>[0-9]+)/$', views.supplierDetail, name='detail'),
url(r'^$', views.index, name='index')
]
]

View File

@ -3,11 +3,13 @@ from django.http import HttpResponse
from .models import Supplier
def index(request):
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})
{'supplier': supplier})