summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py66
1 files changed, 33 insertions, 33 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 725c3ac83..082991824 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -762,38 +762,6 @@ class GeneralType(Cached, models.Model):
item.generate_key()
-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)
- available = models.BooleanField(_(u"Available"), default=True)
-
- class Meta:
- abstract = True
- unique_together = (('label', 'user'),)
-
- def __unicode__(self):
- return self.label
-
- @property
- def cached_label(self):
- return unicode(self)
-
- @classmethod
- def get_short_menu_class(cls, pk):
- 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)
content_type = models.ForeignKey(ContentType)
@@ -1311,7 +1279,7 @@ class IshtarSiteProfile(models.Model, Cached):
u"data can be destructive."))
active = models.BooleanField(_(u"Current active"), default=False)
currency = models.CharField(_(u"Currency"), default=u"€",
- choices=CURRENCY, max_length='5')
+ choices=CURRENCY, max_length=5)
class Meta:
verbose_name = _(u"Ishtar site profile")
@@ -2277,6 +2245,38 @@ class IshtarUser(models.Model):
return res
+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)
+ available = models.BooleanField(_(u"Available"), default=True)
+
+ class Meta:
+ abstract = True
+ unique_together = (('label', 'user'),)
+
+ def __unicode__(self):
+ return self.label
+
+ @property
+ def cached_label(self):
+ return unicode(self)
+
+ @classmethod
+ def get_short_menu_class(cls, pk):
+ return 'basket'
+
+ @property
+ def associated_filename(self):
+ return "{}-{}".format(datetime.date.today().strftime(
+ "%Y-%m-%d"), slugify(self.label))
+
+
class AuthorType(GeneralType):
order = models.IntegerField(_(u"Order"), default=1)