This commit is contained in:
Oliver Walters 2019-05-21 00:31:34 +10:00
parent 72aba30e81
commit 4b41766312
2 changed files with 3 additions and 6 deletions

View File

@ -16,9 +16,6 @@
The BOM for <i>{{ part.full_name }}</i> does not have complete pricing information The BOM for <i>{{ part.full_name }}</i> does not have complete pricing information
</div> </div>
{% endif %} {% endif %}
<div class='panel panel-default'>
Single BOM Price: {{ part.min_bom_price }} to {{ part.max_bom_price }}
</div>
{% if part.bom_checked_date %} {% if part.bom_checked_date %}
{% if part.is_bom_valid %} {% if part.is_bom_valid %}
<div class='alert alert-block alert-info'> <div class='alert alert-block alert-info'>

View File

@ -34,7 +34,7 @@ class PartIndex(ListView):
context_object_name = 'parts' context_object_name = 'parts'
def get_queryset(self): def get_queryset(self):
return Part.objects.all() # filter(category=None) return Part.objects.all().select_related('category')
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
@ -355,7 +355,7 @@ class PartDetail(DetailView):
""" """
context_object_name = 'part' context_object_name = 'part'
queryset = Part.objects.all() queryset = Part.objects.all().select_related('category')
template_name = 'part/detail.html' template_name = 'part/detail.html'
# Add in some extra context information based on query params # Add in some extra context information based on query params
@ -641,7 +641,7 @@ class CategoryDetail(DetailView):
""" Detail view for PartCategory """ """ Detail view for PartCategory """
model = PartCategory model = PartCategory
context_object_name = 'category' context_object_name = 'category'
queryset = PartCategory.objects.all() queryset = PartCategory.objects.all().prefetch_related('children')
template_name = 'part/category.html' template_name = 'part/category.html'