move all PodcastList db queries into separate module
[mygpo.git] / mygpo / share / models.py
blobde7078dea1f99cbd4e246daa103379441f263bad
1 from random import random
3 from couchdbkit.ext.django.schema import *
5 from django.template.defaultfilters import slugify
7 from mygpo.core.proxy import DocumentABCMeta
8 from mygpo.users.models import RatingMixin
9 from mygpo.cache import cache_result
13 class PodcastList(Document, RatingMixin):
14 """ A list of Podcasts that a user creates for the purpose of sharing """
16 __metaclass__ = DocumentABCMeta
18 title = StringProperty(required=True)
19 slug = StringProperty(required=True)
20 podcasts = StringListProperty()
21 user = StringProperty(required=True)
22 random_key = FloatProperty(default=random)
25 def __repr__(self):
26 return '<{cls} "{title}" by {user}>'.format(
27 cls=self.__class__.__name__, title=self.title, user=self.user)