mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-20 13:56:30 +00:00
Fixing python errors
This commit is contained in:
@ -4,14 +4,14 @@ from .models import PartCategory, Part, PartParameter, PartParameterTemplate, Ca
|
||||
|
||||
|
||||
class PartAdmin(admin.ModelAdmin):
|
||||
|
||||
|
||||
list_display = ('name', 'IPN', 'stock', 'category')
|
||||
|
||||
|
||||
class PartCategoryAdmin(admin.ModelAdmin):
|
||||
|
||||
|
||||
list_display = ('name', 'path', 'description')
|
||||
|
||||
|
||||
|
||||
class ParameterTemplateAdmin(admin.ModelAdmin):
|
||||
list_display = ('name', 'units', 'format')
|
||||
@ -20,7 +20,7 @@ class ParameterTemplateAdmin(admin.ModelAdmin):
|
||||
class ParameterAdmin(admin.ModelAdmin):
|
||||
list_display = ('part', 'template', 'value')
|
||||
|
||||
|
||||
|
||||
admin.site.register(Part, PartAdmin)
|
||||
admin.site.register(PartCategory, PartCategoryAdmin)
|
||||
|
||||
|
@ -2,7 +2,6 @@ from __future__ import unicode_literals
|
||||
from django.utils.translation import ugettext as _
|
||||
from django.db import models
|
||||
from django.db.models import Sum
|
||||
from django.core.exceptions import ObjectDoesNotExist, ValidationError
|
||||
|
||||
from InvenTree.models import InvenTreeTree
|
||||
|
||||
@ -116,7 +115,7 @@ class PartParameterTemplate(models.Model):
|
||||
PARAM_BOOL: _("Bool")
|
||||
}
|
||||
|
||||
format = models.IntegerField(
|
||||
format = models.PositiveIntegerField(
|
||||
default=PARAM_NUMERIC,
|
||||
choices=PARAM_TYPE_CODES.items())
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
from django.test import TestCase
|
||||
# from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
|
@ -1,6 +1,4 @@
|
||||
from django.shortcuts import render, get_object_or_404
|
||||
from django.http import HttpResponse, Http404
|
||||
|
||||
from django.http import HttpResponse
|
||||
from rest_framework import generics
|
||||
|
||||
from .models import PartCategory, Part
|
||||
@ -11,9 +9,11 @@ from .serializers import PartCategoryBriefSerializer, PartCategoryDetailSerializ
|
||||
def part_index(request):
|
||||
return HttpResponse("Hello world. This is the parts page")
|
||||
|
||||
|
||||
def category_index(request):
|
||||
return HttpResponse("This is the category page")
|
||||
|
||||
|
||||
class PartDetail(generics.RetrieveAPIView):
|
||||
|
||||
queryset = Part.objects.all()
|
||||
|
Reference in New Issue
Block a user