spradio-server-django/savepointradio/radio/managers.py
2017-12-29 09:56:47 -05:00

14 lines
371 B
Python

from django.db import models
from .querysets import SongQuerySet
class SongManager(models.Manager):
"""
Custom object manager for filtering out common behaviors for a playlist.
"""
def get_queryset(self):
return SongQuerySet(self.model, using=self._db)
def available(self):
return self.get_queryset().songs().enabled().published()