PEP fixes

This commit is contained in:
Oliver Walters 2019-06-05 00:21:19 +10:00
parent c82d5482aa
commit e199ed2281
6 changed files with 15 additions and 20 deletions

View File

@ -21,7 +21,7 @@ class OrderStatus(StatusCode):
COMPLETE = 30 # Order has been completed COMPLETE = 30 # Order has been completed
CANCELLED = 40 # Order was cancelled CANCELLED = 40 # Order was cancelled
LOST = 50 # Order was lost LOST = 50 # Order was lost
RETURNED = 60 # Order was returned RETURNED = 60 # Order was returned
options = { options = {
PENDING: _("Pending"), PENDING: _("Pending"),

View File

@ -71,7 +71,6 @@ class Build(models.Model):
help_text='Number of parts to build' help_text='Number of parts to build'
) )
status = models.PositiveIntegerField(default=BuildStatus.PENDING, status = models.PositiveIntegerField(default=BuildStatus.PENDING,
choices=BuildStatus.items(), choices=BuildStatus.items(),
validators=[MinValueValidator(0)], validators=[MinValueValidator(0)],

View File

@ -150,7 +150,6 @@ class Company(models.Model):
]) ])
class Contact(models.Model): class Contact(models.Model):
""" A Contact represents a person who works at a particular company. """ A Contact represents a person who works at a particular company.
A Company may have zero or more associated Contact objects. A Company may have zero or more associated Contact objects.

View File

@ -2,7 +2,6 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.contrib import admin from django.contrib import admin
from import_export.admin import ImportExportModelAdmin
from .models import PurchaseOrder, PurchaseOrderLineItem from .models import PurchaseOrder, PurchaseOrderLineItem

View File

@ -1,12 +1,10 @@
from django.db import models, transaction from django.db import models
from django.core.validators import MinValueValidator from django.core.validators import MinValueValidator
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from part.models import Part
from company.models import Company from company.models import Company
from stock.models import StockItem
from InvenTree.status_codes import OrderStatus from InvenTree.status_codes import OrderStatus
@ -75,13 +73,15 @@ class PurchaseOrder(Order):
ORDER_PREFIX = "PO" ORDER_PREFIX = "PO"
supplier = models.ForeignKey(Company, on_delete=models.CASCADE, supplier = models.ForeignKey(
limit_choices_to={ Company, on_delete=models.CASCADE,
'is_supplier': True, limit_choices_to={
}, 'is_supplier': True,
related_name='purchase_orders', },
help_text=_('Company') related_name='purchase_orders',
) help_text=_('Company')
)
class OrderLineItem(models.Model): class OrderLineItem(models.Model):
""" Abstract model for an order line item """ Abstract model for an order line item

View File

@ -1,3 +1 @@
from django.test import TestCase # TODO - Implement tests for the order app
# Create your tests here.