diff options
Diffstat (limited to 'ishtar_common/models.py')
| -rw-r--r-- | ishtar_common/models.py | 10 | 
1 files changed, 10 insertions, 0 deletions
| diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 3162a4843..33ae05369 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -480,6 +480,7 @@ class Basket(models.Model):      Abstract class for a basket      Subclass must be defined with an "items" ManyToManyField      """ +    IS_BASKET = True      label = models.CharField(_(u"Label"), max_length=1000)      comment = models.TextField(_(u"Comment"), blank=True, null=True)      user = models.ForeignKey('IshtarUser', blank=True, null=True) @@ -492,6 +493,14 @@ class Basket(models.Model):      def __unicode__(self):          return self.label +    def get_short_menu_class(self): +        return 'basket' + +    @property +    def associated_filename(self): +        return "{}-{}".format(datetime.date.today().strftime( +            "%Y-%m-%d"), slugify(self.label)) +  class ItemKey(models.Model):      key = models.CharField(_(u"Key"), max_length=100) @@ -569,6 +578,7 @@ class HistoryError(Exception):  class BaseHistorizedItem(Imported): +    IS_BASKET = False      history_modifier = models.ForeignKey(          User, related_name='+', on_delete=models.SET_NULL,          verbose_name=_(u"Last editor"), blank=True, null=True) | 
