make django toolbar available

remotes/origin/ESHOP_refactor_products_app
FUNNYDMAN 7 years ago
parent 788ee4f88b
commit 75106ef662
  1. BIN
      asserts/media/categories/C--fakepath-KaspBis_190x220.png
  2. BIN
      asserts/media/categories/C--fakepath-KaspVirt_190x224.png
  3. BIN
      asserts/media/categories/KaspDLP.png
  4. BIN
      asserts/media/categories/KaspHome.png
  5. BIN
      asserts/media/categories/KaspServer.png
  6. BIN
      asserts/media/categories/KaspVirt.png
  7. BIN
      asserts/media/categories/KasperDataCenter.png
  8. BIN
      asserts/media/payment/Payment_foot.jpg
  9. BIN
      asserts/media/payment/Payment_foot.png
  10. BIN
      asserts/media/payment/Payment_header.png
  11. BIN
      asserts/media/payment/payment_header.jpg
  12. BIN
      asserts/media/producers/1C.png
  13. BIN
      asserts/media/producers/Acronis.png
  14. BIN
      asserts/media/producers/Adobe.png
  15. BIN
      asserts/media/producers/Autodesc.png
  16. BIN
      asserts/media/producers/Autodesc_16XiloX.png
  17. BIN
      asserts/media/producers/Corel.png
  18. BIN
      asserts/media/producers/DrWeb.png
  19. BIN
      asserts/media/producers/Eset.png
  20. BIN
      asserts/media/producers/Kerio.png
  21. BIN
      asserts/media/producers/Radmin.png
  22. BIN
      asserts/media/producers/img_1395923930.png
  23. BIN
      asserts/media/producers/img_1395923930_8d2XXg8.png
  24. BIN
      asserts/media/producers/img_1395928950.png
  25. BIN
      asserts/media/producers/kaspersky.png
  26. BIN
      asserts/media/producers_images/Autodesc.png
  27. BIN
      asserts/media/producers_images/acronis.png
  28. BIN
      asserts/media/producers_images/img_1395923930.png
  29. BIN
      asserts/media/producers_images/img_1395928584.png
  30. BIN
      asserts/media/producers_images/img_1395928950.png
  31. BIN
      asserts/media/producers_images/img_microsoft.png
  32. BIN
      asserts/media/products/2017/04/25/thumb_1381486034.jpg
  33. BIN
      asserts/media/products/2017/04/25/thumb_1384933473.jpg
  34. BIN
      asserts/media/products/2017/04/25/thumb_1401701995.png
  35. BIN
      asserts/media/products/2017/04/25/thumb_1424247372.png
  36. BIN
      asserts/media/products/2017/04/25/thumb_1438765887.jpg
  37. BIN
      asserts/media/products/2017/04/25/thumb_1473758588.png
  38. BIN
      asserts/media/products/2017/04/25/thumb_1473758588_2zuWRdC.png
  39. BIN
      asserts/media/products/2017/04/25/thumb_1473758588_86Q6iPb.png
  40. BIN
      asserts/media/products/2017/05/18/office.png
  41. BIN
      asserts/media/products/2017/05/26/office.png
  42. BIN
      asserts/media/products/2017/05/26/thumb_1381486034.jpg
  43. BIN
      asserts/media/products/2017/05/26/thumb_1384933473.jpg
  44. BIN
      asserts/media/products/2017/05/26/thumb_1401701995.png
  45. BIN
      asserts/media/products/2017/05/26/thumb_1424247372.png
  46. BIN
      asserts/media/products/2017/05/26/thumb_1438765887.jpg
  47. BIN
      asserts/media/products/2017/05/26/thumb_1473758588.png
  48. BIN
      asserts/media/products/2017/08/15/AV_noshield_ru.png
  49. BIN
      asserts/media/products/2017/08/15/FLASH.jpg
  50. BIN
      asserts/media/products/2017/08/15/PSHP.jpg
  51. BIN
      asserts/media/products/2017/08/15/product-box-KAV.PNG
  52. BIN
      asserts/media/products/2017/08/15/product-box-KAV_3EiJVdh.PNG
  53. BIN
      asserts/media/products/2017/08/15/product-box-KAV_HDG9zYh.PNG
  54. BIN
      asserts/media/products/2017/08/15/product-box-KAV_IevmPsH.PNG
  55. BIN
      asserts/media/products/2017/08/15/product-box-KISMD.png
  56. BIN
      asserts/media/products/2017/08/16/FLASH.jpg
  57. BIN
      asserts/media/products/2017/08/16/FLASH_zh9HTjk.jpg
  58. BIN
      asserts/media/products/2017/08/16/PSHP.jpg
  59. BIN
      asserts/media/products/2017/08/16/PSHP_f1SnYCA.jpg
  60. BIN
      asserts/media/products/KAV.png
  61. BIN
      asserts/media/products/KIS.png
  62. BIN
      asserts/media/products/KMobil.png
  63. BIN
      asserts/media/products/KSOS.png
  64. BIN
      asserts/media/products/KSOS_FjO7RsO.png
  65. BIN
      asserts/media/products/KSOS_PX7cStV.png
  66. BIN
      asserts/media/products/KSOS_s1wLmcw.png
  67. BIN
      asserts/media/products/KSOS_vuwKkwu.png
  68. BIN
      asserts/media/products/product-box-KAV.PNG
  69. BIN
      asserts/media/products/product-box-KAV_Le1oupJ.PNG
  70. BIN
      asserts/media/products/product-box-KISMD.png
  71. BIN
      asserts/media/products_images/AV_noshield_ru.png
  72. BIN
      asserts/media/products_images/FLASH.jpg
  73. BIN
      asserts/media/products_images/PSHP.jpg
  74. BIN
      asserts/media/products_images/office.png
  75. BIN
      asserts/media/products_images/office_fXQZU7g.png
  76. BIN
      asserts/media/products_images/product-box-KAV.PNG
  77. BIN
      asserts/media/products_images/product-box-KISMD.png
  78. BIN
      asserts/media/products_images/thumb_1381486034.jpg
  79. BIN
      asserts/media/products_images/thumb_1384933473.jpg
  80. BIN
      asserts/media/products_images/thumb_1401701995.png
  81. BIN
      asserts/media/products_images/thumb_1424247372.png
  82. BIN
      asserts/media/products_images/thumb_1438765887.jpg
  83. BIN
      asserts/media/products_images/thumb_1473758588.png
  84. 80
      asserts/static_dev/js/scripts.js
  85. 15
      eshop/eshop_project/settings/base.py
  86. 7
      eshop/eshop_project/tools/secret_gen.py
  87. 55
      eshop/eshop_project/urls.py
  88. 2
      eshop/index/tests/test_views.py
  89. 6
      eshop/products/admin.py
  90. 6
      eshop/products/models.py
  91. BIN
      eshop_old.tar.gz
  92. BIN
      media/producers/1c.png
  93. BIN
      media/producers/avast.png
  94. BIN
      media/producers/roadmin.png
  95. BIN
      media/producers/veeam.png
  96. 65
      media/products/1s/1c.svg
  97. 44
      media/products/antivirus/antivirus.svg
  98. 41
      media/products/grafika-i-video/graphic.svg
  99. 38
      media/products/microsoft/windows.svg
  100. 42
      media/products/ofisnyie-programmyi/office.svg
  101. Some files were not shown because too many files have changed in this diff Show More

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

@ -1,6 +1,6 @@
$(document).ready(function(){
$(document).ready(function () {
var form = $('#form-buying-products');
form.on('submit', function(e){
form.on('submit', function (e) {
e.preventDefault();
$('#number').val();
var nmb = $('#number').val();
@ -22,25 +22,25 @@ $(document).ready(function(){
data: data,
cache: true,
success: function (data) {
if (data.products_total_nmb){
$('#basket_total_nmb').text('('+data.products_total_nmb+')');
if (data.products_total_nmb) {
$('#basket_total_nmb').text('(' + data.products_total_nmb + ')');
$('.basket-items ul').html("");
$.each(data.products, function(k, v){
$('.basket-items ul').append('<li>'+v.name+', ' + v.nmb + 'pc. ' + 'for ' + v.price_per_item + 'rub. ' +
$.each(data.products, function (k, v) {
$('.basket-items ul').append('<li>' + v.name + ', ' + v.nmb + 'pc. ' + 'for ' + v.price_per_item + 'rub. ' +
//'<a class="delete-item" href="">x</a>'+
'</li>');
'</li>');
});
}
},
error: function(){
console.log("error")
}
error: function () {
console.log("error")
}
});
});
calculate();
function showingBasket(){
function showingBasket() {
$('.basket-items').removeClass('hidden');
};
@ -49,18 +49,18 @@ $(document).ready(function(){
// showingBasket();
//});
$('.basket-container').mouseover(function(){
showingBasket();
});
$('.basket-container').mouseover(function () {
showingBasket();
});
$('.basket-container').mouseout(function(){
showingBasket();
});
$('.basket-container').mouseout(function () {
showingBasket();
});
$(document).on('click', '.delete-item', function(e){
e.preventDefault();
$(this).closest('li').remove();
})
$(document).on('click', '.delete-item', function (e) {
e.preventDefault();
$(this).closest('li').remove();
})
});
function showOrHide(cb, cat) {
@ -70,7 +70,7 @@ function showOrHide(cb, cat) {
else cat.style.display = "none";
}
function _discount(quantity, discount_policy){
function _discount(quantity, discount_policy) {
if (isNaN(discount_policy)) {
return 1
}
@ -78,7 +78,7 @@ function _discount(quantity, discount_policy){
var keys = Object.keys(discount_policy);
for (var i = 0, len = keys.length; i < len; i++) {
var split_entry = keys[i].split('-');
if (parseInt(split_entry[0]) <= quantity && quantity < parseFloat(split_entry[1])){
if (parseInt(split_entry[0]) <= quantity && quantity < parseFloat(split_entry[1])) {
return parseFloat(discount_policy[keys[i]]);
}
}
@ -86,7 +86,7 @@ function _discount(quantity, discount_policy){
}
function calculate(){
function calculate() {
var count = document.getElementById("variant_length").value;
var quantity = document.getElementById("quantity").value;
var result = document.getElementById("result");
@ -117,14 +117,14 @@ function calculate(){
for (var i = 0, len = variants.length; i < len; i++) {
if (variants[i]['attributes'][quant0.name] == quant0_val['name'] &&
variants[i]['attributes'][quant1.name] == quant1_val['name']) {
tmp_price = Math.round(variants[i]['price'] * _discount(quantity, discount_policy));
result.innerHTML = tmp_price;
price_per_itom.value = tmp_price;
tmp_price = tmp_price * quantity;
result_itog.innerHTML = tmp_price;
erw.innerHTML = Math.round(tmp_price * 0.05);
product_slug.value = variants[i].slug;
}
tmp_price = Math.round(variants[i]['price'] * _discount(quantity, discount_policy));
result.innerHTML = tmp_price;
price_per_itom.value = tmp_price;
tmp_price = tmp_price * quantity;
result_itog.innerHTML = tmp_price;
erw.innerHTML = Math.round(tmp_price * 0.05);
product_slug.value = variants[i].slug;
}
}
}
else {
@ -132,14 +132,14 @@ function calculate(){
var quant0_val = JSON.parse(quant0.value.replace(/'/g, '"'));
for (var i = 0, len = variants.length; i < len; i++) {
if (variants[i]['attributes'][quant0.name] == quant0_val['name']) {
tmp_price = Math.round(variants[i]['price'] * _discount(quantity, discount_policy));
result.innerHTML = tmp_price;
price_per_itom.value = tmp_price;
tmp_price = tmp_price * quantity;
result_itog.innerHTML = tmp_price;
erw.innerHTML = Math.round(tmp_price * 0.05);
product_slug.value = variants[i].slug;
}
tmp_price = Math.round(variants[i]['price'] * _discount(quantity, discount_policy));
result.innerHTML = tmp_price;
price_per_itom.value = tmp_price;
tmp_price = tmp_price * quantity;
result_itog.innerHTML = tmp_price;
erw.innerHTML = Math.round(tmp_price * 0.05);
product_slug.value = variants[i].slug;
}
}
}
}

@ -1,15 +1,3 @@
"""
Django settings for Eshop project.
Generated by 'django-admin startproject' using Django 1.10.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
from django.urls import reverse_lazy
@ -188,9 +176,6 @@ DISPOSABLE_EMAIL_DOMAINS = os.path.join(TEMPLATE_DIR, 'emails/disposable_email_d
# Substituting auth user model
AUTH_USER_MODEL = 'accounts_ext.User'
# Password validation
# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',

@ -12,14 +12,17 @@ try:
except NameError as ne:
import os
from eshop_project.settings.base import BASE_DIR
SECRET_FILE = os.path.join(BASE_DIR, 'secret.txt')
try:
SECRET_KEY = open(SECRET_FILE).read().strip()
except IOError:
try:
import random
SECRET_KEY = ''.join([random.SystemRandom().choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)])
with open(SECRET_FILE,'w') as f:
SECRET_KEY = ''.join(
[random.SystemRandom().choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)])
with open(SECRET_FILE, 'w') as f:
f.write(SECRET_KEY)
except IOError:
Exception('Please create a %s file with random characters \

@ -1,19 +1,4 @@
"""Eshop URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.urls import re_path, include
from django.urls import re_path, path, include
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static
@ -23,36 +8,38 @@ from core import views
admin.autodiscover()
urlpatterns = [
re_path(r'^jet/', include('jet.urls', 'jet')),
re_path(r'^jet/dashboard/', include('jet.dashboard.urls','jet-dashboard')),
re_path(r'^admin/', admin.site.urls),
re_path(r'^jet/', include('jet.urls', 'jet')),
re_path(r'^jet/dashboard/', include('jet.dashboard.urls', 'jet-dashboard')),
re_path(r'^admin/', admin.site.urls),
re_path(r'^ckeditor/', include('ckeditor_uploader.urls')),
re_path(r'^ckeditor/', include('ckeditor_uploader.urls')),
re_path('pages/', include('django.contrib.flatpages.urls')),
re_path('pages/', include('django.contrib.flatpages.urls')),
re_path('accounts/', include(('accounts_ext.urls', 'accounts_ext'), namespace='accounts_ext')),
re_path('accounts/', include('registration.backends.default.urls')),
re_path('accounts/', include(('django.contrib.auth.urls', 'django.contrib.auth'), namespace='accounts')),
re_path('accounts/', include(('accounts_ext.urls', 'accounts_ext'), namespace='accounts_ext')),
re_path('accounts/', include('registration.backends.default.urls')),
re_path('accounts/',
include(('django.contrib.auth.urls', 'django.contrib.auth'), namespace='accounts')),
re_path(r'', include(('index.urls', 'index'), namespace='index')),
re_path(r'^contact-us/', include(('contact_us.urls', 'contact_us'), namespace='contact_us')),
re_path(r'', include(('index.urls', 'index'), namespace='index')),
re_path(r'^contact-us/', include(('contact_us.urls', 'contact_us'), namespace='contact_us')),
re_path(r'^products/', include(('products.urls', 'products'), namespace='products')),
re_path(r'^cabinet/', include(('cabinet.urls', 'cabinet'), namespace='cabinet')),
re_path(r'^products/', include(('products.urls', 'products'), namespace='products')),
re_path(r'^cabinet/', include(('cabinet.urls', 'cabinet'), namespace='cabinet')),
re_path(r'^cart/', include(('cart.urls', 'cart'), namespace='cart')),
re_path(r'^cart/', include(('cart.urls', 'cart'), namespace='cart')),
re_path(r'^news/', include(('blog_ext.urls','blog_ext'), namespace='news')),
re_path(r'^news/', include(('blog_ext.urls', 'blog_ext'), namespace='news')),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) \
+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) \
+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
if settings.DEBUG:
import debug_toolbar
urlpatterns = [
re_path(r'^__debug__/', include(debug_toolbar.urls))
] + urlpatterns
path('__debug__/', include(debug_toolbar.urls)),
] + urlpatterns
handler404 = views.Handler404View.as_view()
handler500 = views.Handler500View.as_view()

@ -1,5 +1,5 @@
from django.test import TestCase
from django.urls import resolve, reverse
from django.urls import reverse
from index import views

@ -19,9 +19,11 @@ class CustomModelResource(resources.ModelResource):
"""
try:
row['attributes'] = eval(row['attributes'])
row['discount_policy'] = eval(row['discount_policy'])
except:
pass
try:
row['discount_policy'] = eval(row['discount_policy'])
except:
pass
class CustomManyToManyWidget(widgets.ManyToManyWidget):

@ -61,9 +61,11 @@ class ProductCategory(AbstractStatusMPTTModel):
class MPTTMeta:
order_insertion_by = ('name',)
# If I write unique_together = (_('slug'), _('parent'))
# db shows errors
class Meta:
unique_together = (_('slug'), _('parent'))
ordering = (_('tree_id'), _('level'))
unique_together = ('slug', 'parent')
ordering = ('tree_id', 'level')
verbose_name = _("Категория")
verbose_name_plural = _("Категории")

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="svg2"
xml:space="preserve"
width="489.7601"
height="238.85815"
viewBox="0 0 489.76011 238.85816"
sodipodi:docname="1C.svg"
inkscape:version="0.92.1 r15371"><metadata
id="metadata8"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs6"><clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath18"><path
d="M 0,0 H 595.276 V 595.276 H 0 Z"
id="path16"
inkscape:connector-curvature="0" /></clipPath></defs><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1017"
id="namedview4"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="1.682015"
inkscape:cx="211.29773"
inkscape:cy="30.022029"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="g10" /><g
id="g10"
inkscape:groupmode="layer"
inkscape:label="A9Rdfpkp1_1g2j1kf_6i8"
transform="matrix(1.3333333,0,0,-1.3333333,53.68649,897.18964)"><g
id="g12"
transform="matrix(5.8427196,0,0,5.8427196,-1583.8366,-2391.086)"><g
id="g14"
clip-path="url(#clipPath18)"><g
id="g20"
transform="translate(296.8092,497.8276)"><path
d="m 0,0 c -1.215,0.081 -2.616,0.294 -3.721,0.614 -0.207,0.06 -1.064,0.375 -1.282,0.475 -3.847,1.782 -6.527,5.672 -6.527,10.185 0,6.19 5.036,11.232 11.23,11.232 6.139,0 11.141,-4.956 11.227,-11.076 h 4.057 C 14.898,19.786 8.077,26.558 -0.3,26.558 c -8.427,0 -15.286,-6.855 -15.286,-15.284 0,-5.811 3.268,-10.865 8.053,-13.447 0.864,-0.457 2.104,-0.928 2.525,-1.057 1.364,-0.406 3.038,-0.676 4.528,-0.789 0.506,-0.038 2.273,-0.058 2.788,-0.06 h 27.938 v 4.041 H 2.355 C 1.984,-0.038 0.363,-0.024 0,0 m 2.355,6.345 v 0 c -0.295,0 -1.838,0.01 -2.123,0.034 -0.483,0.041 -1.183,0.113 -1.633,0.216 -0.508,0.136 -0.985,0.316 -1.2,0.434 -1.507,0.815 -2.534,2.409 -2.534,4.245 0,2.671 2.163,4.837 4.835,4.837 2.616,0 4.743,-2.081 4.828,-4.681 h 3.898 c -0.082,4.75 -3.954,8.578 -8.726,8.578 -4.825,0 -8.736,-3.91 -8.736,-8.734 0,-3.402 1.95,-6.34 4.79,-7.779 C -3.809,3.239 -2.987,2.971 -2.753,2.91 -1.951,2.699 -0.874,2.555 0,2.491 0.323,2.464 1.905,2.452 2.239,2.45 V 2.444 H 30.245 V 6.345 Z M -18.086,-4.064 h -4.084 v 26.561 h -5.968 v 4.085 h 10.052 z m -14.536,24.52 v -3.928 h 4.484 V -4.064 h 3.924 v 24.52 z"
style="fill:#ae0001;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path22"
inkscape:connector-curvature="0" /></g></g></g></g></svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" x="0px" y="0px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve" width="512px" height="512px">
<g>
<g>
<path d="M442.434,52.012L275.781,2.863c-12.938-3.817-26.621-3.817-39.563,0L69.567,52.011 c-12.304,3.628-20.897,15.12-20.897,27.948v138.014c0,63.872,19.013,125.375,54.984,177.86 c35.118,51.243,83.991,90.665,141.33,114c3.552,1.445,7.284,2.168,11.016,2.168s7.464-0.724,11.015-2.168 c57.339-23.335,106.212-62.755,141.33-114c35.97-52.486,54.983-113.988,54.983-177.86V79.96 C463.33,67.132,454.737,55.639,442.434,52.012z M440.02,217.972c0,59.147-17.602,116.093-50.901,164.681 c-32.53,47.466-77.79,83.978-130.889,105.587c-1.438,0.585-3.021,0.585-4.459,0c-53.099-21.609-98.36-58.12-130.889-105.587 C89.583,334.065,71.981,277.12,71.981,217.972V79.959c0-2.565,1.719-4.863,4.18-5.589l166.652-49.149 c4.314-1.273,8.751-1.908,13.188-1.908c4.436,0,8.873,0.636,13.187,1.909L435.842,74.37c2.459,0.725,4.178,3.023,4.178,5.589 V217.972z" fill="#ae0001"/>
</g>
</g>
<g>
<g>
<path d="M385.15,103.555l-124.206-36.63c-3.234-0.953-6.652-0.955-9.888,0l-124.203,36.63c-7.382,2.178-12.539,9.074-12.539,16.77 v97.647c0,51.598,15.608,101.088,45.134,143.122c22.892,32.593,53.481,59.502,88.458,77.82c2.534,1.328,5.314,1.991,8.095,1.991 c2.78,0,5.56-0.663,8.095-1.991c34.976-18.317,65.565-45.228,88.458-77.82c29.526-42.033,45.134-91.524,45.134-143.122v-97.647 C397.687,112.627,392.531,105.732,385.15,103.555z M374.378,217.972c0,46.777-14.142,91.635-40.897,129.723 c-20.172,28.717-46.912,52.562-77.48,69.12c-30.568-16.559-57.309-40.403-77.48-69.12 c-26.755-38.088-40.897-82.946-40.897-129.723v-93.29L256.001,89.77l118.377,34.912V217.972z" fill="#ae0001"/>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 470.021 470.021" style="enable-background:new 0 0 470.021 470.021;" xml:space="preserve" width="512px" height="512px">
<g>
<path d="M85.283,62.802c-6.009,0-11.66,2.34-15.91,6.59c-8.771,8.772-8.771,23.047,0.001,31.82c4.25,4.249,9.9,6.589,15.91,6.59 c6.009-0.001,11.659-2.341,15.91-6.591c8.771-8.772,8.771-23.047-0.001-31.82C96.943,65.142,91.293,62.801,85.283,62.802z M90.587,90.604c-1.417,1.417-3.301,2.197-5.304,2.197c-2.004,0-3.888-0.78-5.304-2.196c-2.924-2.925-2.924-7.684-0.001-10.607 c1.417-1.417,3.301-2.196,5.305-2.196c2.003,0,3.887,0.779,5.303,2.195C93.51,82.922,93.51,87.681,90.587,90.604z" fill="#ae0001"/>
<path d="M400.63,400.647c8.771-8.772,8.771-23.047-0.001-31.82c-4.25-4.249-9.9-6.589-15.909-6.589c-6.01,0-11.66,2.34-15.911,6.59 c-8.771,8.772-8.771,23.047,0.001,31.82c4.25,4.249,9.9,6.59,15.91,6.59C390.729,407.238,396.379,404.897,400.63,400.647z M379.416,379.435c1.417-1.417,3.301-2.196,5.305-2.196c2.003,0,3.887,0.779,5.303,2.195c2.924,2.925,2.924,7.684,0.001,10.607 c-1.417,1.417-3.301,2.197-5.304,2.197c-2.004,0-3.888-0.78-5.304-2.196C376.493,387.117,376.493,382.358,379.416,379.435z" fill="#ae0001"/>
<path d="M127.168,229.717c1.465,1.464,3.385,2.196,5.304,2.196s3.839-0.732,5.304-2.196c2.929-2.93,2.929-7.678,0-10.607 L18.108,99.443l81.317-81.317l53.032,53.033l-22.981,22.98c-2.929,2.93-2.929,7.678,0,10.607c1.465,1.464,3.385,2.196,5.304,2.196 s3.839-0.732,5.304-2.196l22.981-22.98l20.057,20.058l-22.98,22.98c-2.929,2.93-2.929,7.678,0,10.607 c1.465,1.464,3.385,2.196,5.304,2.196s3.839-0.732,5.304-2.196l22.98-22.98l20.058,20.058l-22.98,22.98 c-2.929,2.93-2.929,7.678,0,10.607c1.465,1.464,3.385,2.196,5.304,2.196s3.839-0.732,5.304-2.196l28.284-28.284 c2.929-2.93,2.929-7.678,0-10.607L104.729,2.216c-2.93-2.928-7.678-2.928-10.607,0L2.198,94.14c-2.929,2.93-2.929,7.678,0,10.607 L127.168,229.717z" fill="#ae0001"/>
<path d="M342.836,240.322c-2.93-2.928-7.678-2.928-10.607,0l-28.284,28.284c-2.929,2.93-2.929,7.678,0,10.607 c1.465,1.464,3.385,2.196,5.304,2.196s3.839-0.732,5.304-2.196l22.98-22.98l20.058,20.058l-22.98,22.98 c-2.929,2.93-2.929,7.678,0,10.607c1.465,1.464,3.385,2.196,5.304,2.196s3.839-0.732,5.304-2.196l22.98-22.98l20.058,20.058 l-22.981,22.98c-2.929,2.93-2.929,7.678,0,10.607c1.465,1.464,3.385,2.196,5.304,2.196s3.839-0.732,5.304-2.196l22.981-22.98 l53.033,53.032l-81.317,81.317L250.912,332.246c-2.93-2.928-7.678-2.928-10.607,0c-2.929,2.93-2.929,7.678,0,10.607l124.97,124.97 c1.465,1.464,3.385,2.196,5.304,2.196s3.839-0.732,5.304-2.196l91.924-91.924c2.929-2.93,2.929-7.678,0-10.607L342.836,240.322z" fill="#ae0001"/>
<path d="M397.34,153.999c0.016-0.016,61.715-61.716,61.715-61.716c14.62-14.621,14.62-38.412,0-53.033l-28.284-28.284 c-14.621-14.619-38.411-14.623-53.034,0l-14.144,14.144c-2.929,2.93-2.929,7.678,0,10.607c2.93,2.928,7.678,2.928,10.607,0 l14.143-14.144c8.773-8.772,23.047-8.772,31.82,0l28.284,28.284c8.772,8.772,8.772,23.047,0,31.819l-30.052,30.053l-65.407-65.407 c-2.93-2.928-7.678-2.928-10.607,0l-26.342,26.342c-0.018,0.018-264.344,264.344-264.344,264.344 c-0.015,0.015-0.027,0.031-0.042,0.047c-0.063,0.064-0.121,0.133-0.181,0.2c-0.592,0.647-1.073,1.388-1.408,2.201l-28.872,70.116 c-0.01,0.024-0.02,0.048-0.029,0.071L0.565,459.665c-1.152,2.8-0.509,6.018,1.632,8.159c1.436,1.435,3.354,2.196,5.306,2.196 c0.961,0,1.93-0.185,2.854-0.564l50.027-20.6c0.019-0.008,0.038-0.016,0.058-0.023l70.124-28.875 c0.817-0.337,1.561-0.821,2.211-1.417c0.063-0.057,0.127-0.111,0.188-0.17c0.016-0.016,0.034-0.029,0.05-0.045L397.34,153.999z M130.295,399.829c-2.018-3.443-4.489-6.651-7.364-9.527c-5.88-5.88-13.012-9.975-20.57-12.034l195.992-195.992 c2.929-2.93,2.929-7.678,0-10.607c-2.93-2.928-7.678-2.928-10.607,0L91.754,367.66c-2.06-7.559-6.155-14.69-12.035-20.57 c-2.876-2.875-6.084-5.346-9.528-7.364L321.334,88.584l24.748,24.748l-30.052,30.052c-2.929,2.93-2.929,7.678,0,10.607 c1.465,1.464,3.385,2.196,5.304,2.196s3.839-0.732,5.304-2.196l30.052-30.052l24.749,24.748L130.295,399.829z M59.356,433.057 l-22.392-22.391l24.206-58.785c2.888,1.496,5.576,3.449,7.942,5.816c7.088,7.087,10.372,16.711,8.784,25.742 c-0.424,2.409,0.354,4.873,2.083,6.603c1.729,1.729,4.194,2.507,6.603,2.083c9.032-1.588,18.655,1.697,25.742,8.784 c2.367,2.366,4.32,5.054,5.816,7.942L59.356,433.057z M347.685,62.232l60.104,60.104l-15.745,15.744l-60.104-60.104L347.685,62.232 z M30.776,425.692l13.552,13.553l-23.039,9.486L30.776,425.692z" fill="#ae0001"/>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.7 KiB

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
<g>
<path d="M206.115,255.958c-23.854-12.259-47.043-18.479-68.94-18.479c-2.978,0-5.976,0.09-8.974,0.354 c-27.94,2.312-53.461,9.684-69.875,15.414c-4.354,1.599-8.817,3.288-13.415,5.151L0,414.097 c30.851-11.416,58.146-16.97,83.135-16.97c40.423,0,69.764,15.104,93.996,30.652c11.481-38.96,39.022-133.046,47.241-161.162 C218.397,262.976,212.334,259.333,206.115,255.958z M264.174,295.536L218.951,452.61c13.416,7.686,58.549,32.023,93.105,32.023 c27.895,0,59.125-7.146,95.416-21.896l43.18-150.988c-29.316,9.461-57.438,14.26-83.732,14.26 C318.945,326.01,285.363,310.461,264.174,295.536z M146.411,184.396c38.559,0.399,67.076,15.104,90.708,30.251l46.376-158.672 c-9.772-5.598-35.403-19.547-53.929-24.3c-12.193-2.842-25.01-4.308-38.602-4.308c-25.898,0.488-54.194,6.973-86.444,19.9 L60.3,202.564c32.404-12.218,60.322-18.17,86.043-18.17C146.366,184.396,146.411,184.396,146.411,184.396z M512,99.062 c-29.406,11.416-58.104,17.233-85.514,17.233c-45.844,0-79.646-15.901-101.547-31.183L278.964,244.23 c30.874,19.854,64.146,29.939,99.062,29.939c28.475,0,57.971-6.84,87.73-20.344l-0.092-1.111l1.867-0.443L512,99.062z" fill="#ae0001"/>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 60 60" style="enable-background:new 0 0 60 60;" xml:space="preserve" width="512px" height="512px">
<g>
<path d="M45,25H20c-0.552,0-1,0.447-1,1s0.448,1,1,1h25c0.552,0,1-0.447,1-1S45.552,25,45,25z" fill="#ae0001"/>
<path d="M20,19h10c0.552,0,1-0.447,1-1s-0.448-1-1-1H20c-0.552,0-1,0.447-1,1S19.448,19,20,19z" fill="#ae0001"/>
<path d="M45,33H20c-0.552,0-1,0.447-1,1s0.448,1,1,1h25c0.552,0,1-0.447,1-1S45.552,33,45,33z" fill="#ae0001"/>
<path d="M45,41H20c-0.552,0-1,0.447-1,1s0.448,1,1,1h25c0.552,0,1-0.447,1-1S45.552,41,45,41z" fill="#ae0001"/>
<path d="M45,49H20c-0.552,0-1,0.447-1,1s0.448,1,1,1h25c0.552,0,1-0.447,1-1S45.552,49,45,49z" fill="#ae0001"/>
<path d="M49,14.586V0H6v55h5v5h43V19.586L49,14.586z M40,8.414l9,9L50.586,19H40V8.414z M8,53V2h39v10.586L39.414,5H11v48H8z M13,58v-3V7h25v14h14v37H13z" fill="#ae0001"/>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save