remotes/origin/mitri4
spacenergy 10 years ago
parent 8c501cf69d
commit c6b55e032e
  1. 1
      batiskaf/templates/jinja2/category.jinja
  2. 10
      batiskaf/templates/jinja2/product.jinja
  3. 1
      main/management/__init__.py
  4. 1
      main/management/commands/__init__.py
  5. 13
      main/management/commands/product_update.py
  6. 21
      main/migrations/0011_productsupdate.py
  7. 4
      main/models.py
  8. 19
      store/migrations/0042_auto_20151126_1142.py
  9. 2
      store/views.py

@ -79,7 +79,6 @@
{# <a href="{{ child.get_absolute_url() }}">{{ child.title }}</a>#} {# <a href="{{ child.get_absolute_url() }}">{{ child.title }}</a>#}
{# </li>#} {# </li>#}
{% endfor %} {% endfor %}
{% elif products %} {% elif products %}
<div class="category-paginator"> <div class="category-paginator">

@ -44,7 +44,7 @@
<div class="col-xs-6 product-short-description"> <div class="col-xs-6 product-short-description">
<h1 style="font-size:19px; margin-top:0;" class="text-left">{{ product.title }}</h1 style="font-size:18px;"> <h1 style="font-size:19px; margin-top:0;" class="text-left">{{ product.title }}</h1>
@ -71,6 +71,7 @@
</select> </select>
</div> </div>
{% if 'suits' in request.path %} {% if 'suits' in request.path %}
@ -85,7 +86,6 @@
<option value="{{ count_val + 1 }}">{{ count_val + 1 }} шт.</option> <option value="{{ count_val + 1 }}">{{ count_val + 1 }} шт.</option>
{% endfor %} {% endfor %}
</select> </select>
<br/>
<div class="row"> <div class="row">
<div class="itogo col-xs-6"> <div class="itogo col-xs-6">
@ -106,7 +106,11 @@
style="max-width: 200px"><span><span style="max-width: 200px"><span><span
class="glyphicon glyphicon-import" aria-hidden="true"></span> Заказать</span></a> class="glyphicon glyphicon-import" aria-hidden="true"></span> Заказать</span></a>
</div> </div>
<br/>
<br>
<div class="text-success" style="font-size: 13px"><em>Цены и наличие товара актуальны на {{ updated.created.strftime('%d.%m %H:%M') }}</em></div>
<div class="tags"> <div class="tags">
<h5 class="text-left"> <h5 class="text-left">
Поделиться ссылкой:</h5> Поделиться ссылкой:</h5>

@ -0,0 +1 @@
__author__ = 'OG'

@ -0,0 +1,13 @@
from django.core.management.base import BaseCommand, CommandError
from django.utils import timezone
from main.models import ProductsUpdate
class Command(BaseCommand):
def handle(self, *args, **options):
p = ProductsUpdate.objects.last()
if not p:
p = ProductsUpdate.objects.create(created=timezone.now())
p.created = timezone.now()
p.save()
self.stdout.write('{}'.format(p.created))

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('main', '0010_auto_20150701_1216'),
]
operations = [
migrations.CreateModel(
name='ProductsUpdate',
fields=[
('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)),
('created', models.DateTimeField(auto_now=True, verbose_name='Дата и время')),
],
),
]

@ -42,3 +42,7 @@ class Feedback(models.Model):
def __str__(self): def __str__(self):
return '{}: {}'.format(self.name, self.text) return '{}: {}'.format(self.name, self.text)
class ProductsUpdate(models.Model):
created = models.DateTimeField('Дата и время', editable=False, auto_now=True)

File diff suppressed because one or more lines are too long

@ -8,6 +8,7 @@ from django.views.generic import *
from accounts.models import Profile from accounts.models import Profile
from accounts.utils import normalize_phone, send_email from accounts.utils import normalize_phone, send_email
from batiskaf.jinja2_ext.html_filters import escape from batiskaf.jinja2_ext.html_filters import escape
from main.models import ProductsUpdate
from .models import * from .models import *
from store.alemtat import AlemTat from store.alemtat import AlemTat
from store.cart import Cart, CartItem from store.cart import Cart, CartItem
@ -161,6 +162,7 @@ class ProductView(CategoryBaseView, DetailView):
retval = super(ProductView, self).get_context_data() retval = super(ProductView, self).get_context_data()
retval['category'] = self.category retval['category'] = self.category
retval['form'] = ProductFeedbackForm(self.request.POST or None) retval['form'] = ProductFeedbackForm(self.request.POST or None)
retval['updated'] = ProductsUpdate.objects.last()
return retval return retval
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):

Loading…
Cancel
Save