jaywink /
kakaravaara3
| 1 | # -*- coding: utf-8 -*- |
||
| 2 | from __future__ import unicode_literals |
||
| 3 | |||
| 4 | from django.conf import settings |
||
| 5 | from django.db import models |
||
| 6 | from django.utils.translation import ugettext_lazy as _ |
||
| 7 | |||
| 8 | from shoop.core.fields import MoneyValueField |
||
| 9 | from shoop.utils.properties import MoneyPropped |
||
| 10 | |||
| 11 | |||
| 12 | class PeriodPriceModifier(MoneyPropped, models.Model): |
||
| 13 | product = models.ForeignKey("shoop.Product", related_name="period_price_modifiers", on_delete=models.CASCADE) |
||
| 14 | modifier = MoneyValueField() |
||
| 15 | start_date = models.DateField() |
||
| 16 | end_date = models.DateField() |
||
| 17 | |||
| 18 | class Meta: |
||
| 19 | unique_together = (("product", "start_date", "end_date")) |
||
| 20 | verbose_name = _(u"period price modifier") |
||
| 21 | verbose_name_plural = _(u"period price modifiers") |
||
| 22 | |||
| 23 | def __repr__(self): |
||
| 24 | return "<PeriodPriceModifier (%s, %s, %s, %s)" % ( |
||
| 25 | self.product_id, |
||
|
0 ignored issues
–
show
|
|||
| 26 | self.start_date.strftime(settings.SHORT_DATE_FORMAT), |
||
| 27 | self.end_date.strftime(settings.SHORT_DATE_FORMAT), |
||
| 28 | self.modifier, |
||
| 29 | ) |
||
| 30 |
This check looks for calls to members that are non-existent. These calls will fail.
The member could have been renamed or removed.