diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-05-14 16:22:06 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-05-14 16:22:06 +0200 |
commit | b114fa6d0b42a0ba2bc1a1988c1714f48d6a5474 (patch) | |
tree | 37c879eff5536103bd969f75096e5781b906889e /ishtar_common | |
parent | e7039bdc30c43b488b8393338c53552de6cb0145 (diff) | |
download | Ishtar-b114fa6d0b42a0ba2bc1a1988c1714f48d6a5474.tar.bz2 Ishtar-b114fa6d0b42a0ba2bc1a1988c1714f48d6a5474.zip |
Finds: basket (db)
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/models.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 9509b36a6..3162a4843 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -475,6 +475,24 @@ class GeneralType(models.Model, Cached): item.generate_key() +class Basket(models.Model): + """ + Abstract class for a basket + Subclass must be defined with an "items" ManyToManyField + """ + 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 + + class ItemKey(models.Model): key = models.CharField(_(u"Key"), max_length=100) content_type = models.ForeignKey(ContentType) |