diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index 4442ea2525..e400b50306 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -5,9 +5,11 @@ from django.db import models from part.models import Part from InvenTree.models import InvenTreeTree + class Warehouse(InvenTreeTree): pass + class StockItem(models.Model): part = models.ForeignKey(Part, on_delete=models.CASCADE) @@ -31,6 +33,6 @@ class StockItem(models.Model): def __str__(self): return "{n} x {part} @ {loc}".format( - n = self.quantity, - part = self.part.name, - loc = self.location.name) \ No newline at end of file + n=self.quantity, + part=self.part.name, + loc=self.location.name) diff --git a/InvenTree/stock/urls.py b/InvenTree/stock/urls.py index d878de5869..9cb3403af4 100644 --- a/InvenTree/stock/urls.py +++ b/InvenTree/stock/urls.py @@ -3,5 +3,5 @@ from django.conf.urls import url from . import views urlpatterns = [ - url(r'^$', views.index, name='index') -] \ No newline at end of file + url(r'^$', views.index, name='index') +] diff --git a/InvenTree/stock/views.py b/InvenTree/stock/views.py index 2f76a07800..2b4bc2262e 100644 --- a/InvenTree/stock/views.py +++ b/InvenTree/stock/views.py @@ -3,10 +3,12 @@ from django.http import HttpResponse from .models import Warehouse, StockItem + def index(request): - warehouses = Warehouse.objects.filter(parent = None) + warehouses = Warehouse.objects.filter(parent=None) return render(request, 'stock/index.html', {'warehouses': warehouses - }) \ No newline at end of file + } + ) \ No newline at end of file diff --git a/InvenTree/supplier/admin.py b/InvenTree/supplier/admin.py index 227c0a0d0a..1e4eb51126 100644 --- a/InvenTree/supplier/admin.py +++ b/InvenTree/supplier/admin.py @@ -2,9 +2,10 @@ from django.contrib import admin from .models import Supplier, SupplierPart, Customer + class CompanyAdmin(admin.ModelAdmin): - list_display=('name','URL','contact') + list_display = ('name', 'URL', 'contact') admin.site.register(Customer, CompanyAdmin) admin.site.register(Supplier, CompanyAdmin) -admin.site.register(SupplierPart) \ No newline at end of file +admin.site.register(SupplierPart) diff --git a/InvenTree/supplier/models.py b/InvenTree/supplier/models.py index 6cd9935be7..17607d875e 100644 --- a/InvenTree/supplier/models.py +++ b/InvenTree/supplier/models.py @@ -14,6 +14,8 @@ class Supplier(Company): class Customer(Company): + """ Represents a customer + """ pass @@ -31,14 +33,12 @@ class SupplierPart(models.Model): MPN = models.CharField(max_length=100) URL = models.URLField(blank=True) - description = models.CharField(max_length=250, - blank=True) - + description = models.CharField(max_length=250, blank=True) def __str__(self): return "{mpn} - {supplier}".format( - mpn = self.MPN, - supplier = self.supplier.name) + mpn=self.MPN, + supplier=self.supplier.name) class SupplierPriceBreak(models.Model):