PEP fixes

This commit is contained in:
Oliver Walters 2019-04-16 22:32:43 +10:00
parent 7eea9d1a20
commit 01bdf2f19b
6 changed files with 26 additions and 38 deletions

View File

@ -1,7 +1,7 @@
import io
import os
from wsgiref.util import FileWrapper
from django.http import StreamingHttpResponse, HttpResponse
from django.http import StreamingHttpResponse
def WrapWithQuotes(text):

View File

@ -145,8 +145,6 @@ class AjaxCreateView(AjaxMixin, CreateView):
return super(CreateView, self).post(request, *args, **kwargs)
class AjaxUpdateView(AjaxMixin, UpdateView):
""" An 'AJAXified' UpdateView for updating an object in the db
@ -187,8 +185,6 @@ class AjaxUpdateView(AjaxMixin, UpdateView):
return super(UpdateView, self).post(request, *args, **kwargs)
class AjaxDeleteView(AjaxMixin, DeleteView):
""" An 'AJAXified DeleteView for removing an object from the DB

View File

@ -5,7 +5,7 @@ from django_filters.rest_framework import DjangoFilterBackend
from rest_framework import filters
from rest_framework import generics, permissions
from django.conf.urls import url, include
from django.conf.urls import url
from .models import Build
from .serializers import BuildSerializer
@ -30,6 +30,7 @@ class BuildList(generics.ListAPIView):
'part',
]
build_api_urls = [
url(r'^.*$', BuildList.as_view(), name='api-build-list')
]

View File

@ -320,7 +320,6 @@ class Part(models.Model):
else:
return None
def export_bom_csv(self, **kwargs):
# Construct header line
@ -336,26 +335,19 @@ class Part(models.Model):
return out
def export_bom_xls(self, **kwargs):
return ''
def export_bom_xml(self, **kwargs):
return ''
def export_bom_htm(self, **kwargs):
return ''
def export_bom_pdf(self, **kwargs):
return ''
"""
@property
def projects(self):

View File

@ -3,8 +3,7 @@ from __future__ import unicode_literals
from django.shortcuts import get_object_or_404
from django.template.loader import render_to_string
from django.urls import reverse_lazy, reverse
from django.urls import reverse_lazy
from django.views.generic import DetailView, ListView
from company.models import Company
@ -19,10 +18,11 @@ from .forms import BomExportForm
from .forms import EditSupplierPartForm
from InvenTree.views import AjaxMixin, AjaxView, AjaxCreateView, AjaxUpdateView, AjaxDeleteView
from InvenTree.views import AjaxView, AjaxCreateView, AjaxUpdateView, AjaxDeleteView
from InvenTree.helpers import DownloadFile
class PartIndex(ListView):
model = Part
template_name = 'part/category.html'
@ -129,7 +129,6 @@ class BomExport(AjaxView):
model = Part
ajax_form_title = 'Export BOM'
ajax_template_name = 'part/bom_export.html'
#template_name = 'modal_form.html'
context_object_name = 'part'
form_class = BomExportForm
@ -139,6 +138,7 @@ class BomExport(AjaxView):
def get(self, request, *args, **kwargs):
form = self.form_class()
"""
part = self.get_object()
context = {
@ -146,18 +146,17 @@ class BomExport(AjaxView):
}
if request.is_ajax():
pass
passs
"""
return self.renderJsonResponse(request, form, context=context)
return self.renderJsonResponse(request, form)
def post(self, request, *args, **kwargs):
"""
User has now submitted the BOM export data
"""
part = self.get_object()
print("POSTED")
# part = self.get_object()
return super(AjaxView, self).post(request, *args, **kwargs)

View File

@ -80,9 +80,9 @@ class StockItemEdit(AjaxUpdateView):
model = StockItem
form_class = EditStockItemForm
template_name = 'stock/item_edit.html'
# template_name = 'stock/item_edit.html'
context_object_name = 'item'
#ajax_template_name = 'modal_form.html'
ajax_template_name = 'modal_form.html'
ajax_form_title = 'Edit Stock Item'