mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
pepe is a racist meme
This commit is contained in:
parent
9aebdab1c2
commit
a5009147c3
@ -34,6 +34,7 @@ class SupplierPart(models.Model):
|
|||||||
description = models.CharField(max_length=250,
|
description = models.CharField(max_length=250,
|
||||||
blank=True)
|
blank=True)
|
||||||
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "{mpn} - {supplier}".format(
|
return "{mpn} - {supplier}".format(
|
||||||
mpn = self.MPN,
|
mpn = self.MPN,
|
||||||
@ -53,9 +54,10 @@ class SupplierPriceBreak(models.Model):
|
|||||||
currency = models.CharField(max_length=10,
|
currency = models.CharField(max_length=10,
|
||||||
blank=True)
|
blank=True)
|
||||||
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "{mpn} - {cost}{currency} @ {quan}".format(
|
return "{mpn} - {cost}{currency} @ {quan}".format(
|
||||||
mpn=part.MPN,
|
mpn=part.MPN,
|
||||||
cost=self.cost,
|
cost=self.cost,
|
||||||
currency=self.currency if self.currency else '',
|
currency=self.currency if self.currency else '',
|
||||||
quan=self.quantity)
|
quan=self.quantity)
|
||||||
|
@ -8,4 +8,4 @@ urlpatterns = [
|
|||||||
url(r'^(?P<supplier_id>[0-9]+)/$', views.supplierDetail, name='detail'),
|
url(r'^(?P<supplier_id>[0-9]+)/$', views.supplierDetail, name='detail'),
|
||||||
|
|
||||||
url(r'^$', views.index, name='index')
|
url(r'^$', views.index, name='index')
|
||||||
]
|
]
|
||||||
|
@ -3,11 +3,13 @@ from django.http import HttpResponse
|
|||||||
|
|
||||||
from .models import Supplier
|
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):
|
def supplierDetail(request, supplier_id):
|
||||||
supplier = get_object_or_404(Supplier, pk=supplier_id)
|
supplier = get_object_or_404(Supplier, pk=supplier_id)
|
||||||
|
|
||||||
return render(request, 'supplier/detail.html',
|
return render(request, 'supplier/detail.html',
|
||||||
{'supplier': supplier})
|
{'supplier': supplier})
|
||||||
|
@ -2,7 +2,8 @@ from django.contrib import admin
|
|||||||
|
|
||||||
from .models import UniquePart
|
from .models import UniquePart
|
||||||
|
|
||||||
|
|
||||||
class UniquePartAdmin(admin.ModelAdmin):
|
class UniquePartAdmin(admin.ModelAdmin):
|
||||||
list_display = ('part', 'revision', 'serial', 'creation_date')
|
list_display = ('part', 'revision', 'serial', 'creation_date')
|
||||||
|
|
||||||
admin.site.register(UniquePart, UniquePartAdmin)
|
admin.site.register(UniquePart, UniquePartAdmin)
|
||||||
|
@ -37,14 +37,14 @@ class UniquePart(models.Model):
|
|||||||
PART_DESTROYED = 50
|
PART_DESTROYED = 50
|
||||||
|
|
||||||
status = models.IntegerField(default=PART_IN_PROGRESS,
|
status = models.IntegerField(default=PART_IN_PROGRESS,
|
||||||
choices=[
|
choices=[
|
||||||
(PART_IN_PROGRESS, "In progress"),
|
(PART_IN_PROGRESS, "In progress"),
|
||||||
(PART_IN_STOCK, "In stock"),
|
(PART_IN_STOCK, "In stock"),
|
||||||
(PART_SHIPPED, "Shipped"),
|
(PART_SHIPPED, "Shipped"),
|
||||||
(PART_RETURNED, "Returned"),
|
(PART_RETURNED, "Returned"),
|
||||||
(PART_DAMAGED, "Damaged"),
|
(PART_DAMAGED, "Damaged"),
|
||||||
(PART_DESTROYED, "Destroyed"),
|
(PART_DESTROYED, "Destroyed"),
|
||||||
])
|
])
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.part.name
|
return self.part.name
|
||||||
@ -59,4 +59,4 @@ class PartTrackingInfo(models.Model):
|
|||||||
part = models.ForeignKey(UniquePart, on_delete=models.CASCADE)
|
part = models.ForeignKey(UniquePart, on_delete=models.CASCADE)
|
||||||
date = models.DateField(auto_now_add=True,
|
date = models.DateField(auto_now_add=True,
|
||||||
editable=False)
|
editable=False)
|
||||||
notes = models.CharField(max_length=500)
|
notes = models.CharField(max_length=500)
|
||||||
|
@ -4,4 +4,3 @@ from django.http import HttpResponse
|
|||||||
|
|
||||||
def index(request):
|
def index(request):
|
||||||
return HttpResponse("This is the Tracking page")
|
return HttpResponse("This is the Tracking page")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user