diff options
Diffstat (limited to 'ishtar_common/models.py')
| -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) | 
