Managers

class fusionbox.db.models.QuerySetManager[source]

http://djangosnippets.org/snippets/734/

Easy extending of the base manager without needing to define multiple managers and queryset classes.

Example Usage

from django.db.models.query import QuerySet
from fusionbox.db.models import QuerySetManager

class Foo(models.Model):
    objects = QuerySetManager()
    class QuerySet(QuerySet):
        def published(self):
            return self.filter(is_published=True)
fusionbox.db.models.generic_upload_to(instance, filename)[source]

Generic upload_to function for models.FileField and models.ImageField which uploads files to <app_label>/<module_name>/<file_name>.