diff --git a/products/models.py b/products/models.py index cf4ef44..25413f6 100644 --- a/products/models.py +++ b/products/models.py @@ -7,7 +7,6 @@ from mptt.models import TreeForeignKey from core.models import AbstractStatusModel, AbstractDateTimeModel, AbstractStatusMPTTModel # ---------------------------------- COMMON PRODUCT STATUS ---------------------------------------# -# Create your models here. STATUS_INACTIVE = 0 STATUS_ACTIVE = 25 STATUS_DELETED = 50 diff --git a/products/templatetags/products_filters.py b/products/templatetags/products_filters.py index b6c3bab..75b95c6 100644 --- a/products/templatetags/products_filters.py +++ b/products/templatetags/products_filters.py @@ -15,12 +15,6 @@ def apply_nds_status(doesNdsInclude): @register.filter def apply_query_params(params, doAppend=False): - """ - - :param params dict: - :param arg return as additional query params or initial: - :return string: - """ formated_params = "" if not params: return formated_params diff --git a/products/utils.py b/products/utils.py index e899f96..73ba0ae 100644 --- a/products/utils.py +++ b/products/utils.py @@ -2,7 +2,9 @@ from django.utils.html_parser import HTMLParser from .models import Product -#@TODO: MAKE DESCTIPTION PREVIEW + +# @TODO: MAKE DESCTIPTION PREVIEW + class ProductDesctipionHtmlParser(HTMLParser): def __init__(self, convert_charrefs=False, **kwargs): @@ -21,7 +23,7 @@ class ProductDesctipionHtmlParser(HTMLParser): super().handle_endtag(tag) -#@TODO: NOT USED. FIGURE OUT THE PUPRPOSE OF THIS CODE +# @TODO: NOT USED. FIGURE OUT THE PUPRPOSE OF THIS CODE def get_variant_picker_data(product): variants = product.variants.all() variant_attributes = product.attributes.all() diff --git a/products/views.py b/products/views.py index 805b8b7..e19f4c8 100644 --- a/products/views.py +++ b/products/views.py @@ -1,14 +1,11 @@ -from functools import reduce - from django.conf import settings -from django.urls import reverse_lazy from django.utils.translation import ugettext_lazy as _ from django.views.generic import ListView, DetailView from cart.forms import CartAddInlineForm from core.utils import parse_path from .forms import (ProductSortForm) -from .models import (Product,ProductCategory) +from .models import (Product, ProductCategory) class ProductDetailView(DetailView): @@ -43,7 +40,7 @@ class ProductListView(ListView): paginate_by = settings.DEFAULT_PAGE_AMOUNT title = _('Каталог') - def filter_products(self,qs): + def filter_products(self, qs): if self.kwargs.get('path'): category_intance = parse_path(self.kwargs.get('path')) cat_qs = ProductCategory.objects.filter(slug__exact=category_intance).first() @@ -59,7 +56,7 @@ class ProductListView(ListView): qs = qs.filter(offer__amount__gte=0) return qs - def sort_products(self,qs): + def sort_products(self, qs): if not self.request.GET: return qs if self.request.GET.get('sort'): @@ -73,8 +70,7 @@ class ProductListView(ListView): return qs def get_cart_add_formset(self, products): - return { product.id: CartAddInlineForm(initial={'offer': product.id,'amount': 1}) for product in products} - + return {product.id: CartAddInlineForm(initial={'offer': product.id, 'amount': 1}) for product in products} def get_product_sorting_form(self): if not "products" in self.request.resolver_match.view_name: diff --git a/templates/products/categorieslist.html b/templates/products/categorieslist.html index c5b9d3e..0f60c4c 100644 --- a/templates/products/categorieslist.html +++ b/templates/products/categorieslist.html @@ -2,39 +2,66 @@ {% load static %} {% block title %} - Categories Page + Categories Page {% endblock %} {% block content %}
-
-
-
- -
-
-
-
-
- {% for category in categories %} - - {% endfor %} - {% for product in products %} -
- - - - {{ product.name }}
-

- {{ product.price }} rub. -

+
+
+
+ +
+
+
+
+
+ {% for category in categories %} + + {% endfor %} + {% for product in products %} +
+ + + + {{ product.name }}
+

+ {{ product.price }} rub. +

+
+ {% endfor %}
- {% endfor %}
-
{% endblock %} \ No newline at end of file diff --git a/templates/products/list.html b/templates/products/list.html deleted file mode 100644 index 2a4e016..0000000 --- a/templates/products/list.html +++ /dev/null @@ -1,200 +0,0 @@ -{% extends 'base.html' %} -{% load static %} - -{% block title %} - Producers Page -{% endblock %} - -{% block content %} - - - - - - - - - - - - - - - - - -
-
-
- - - -
-
-
Не нашли нужную программу - или разработчика? - Заполните форму и с Вами - свяжется наш специалист. -
- - - - - -
-
-
-
-
-
-
-
-
- -
-
- -
-
-
- -
- - - -
-
Выбор ПО по разработчику
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
-
Наши клиенты
-
-
    -
  • -
  • -
  • -
-
-
Наши сертефикаты
-
- - -
-
-
-
- -{% endblock %} \ No newline at end of file