# Path: djam/views/base.py
# class DefaultRedirectView(RedirectView):
#     permanent = False
# 
#     def get_redirect_url(self, **kwargs):
#         return self.riff.get_default_url()


from django.conf.urls import patterns, include, url
from django.core.urlresolvers import reverse
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponseForbidden
from django.template.defaultfilters import slugify
from django.utils.datastructures import SortedDict
from djam.views.base import DefaultRedirectView
    default_redirect_view = DefaultRedirectView
    widget_template = 'djam/_widget.html'

    def __init__(self, parent=None, namespace=None, app_name=None):
        self.parent = parent
        if self.display_name is None:
            raise ImproperlyConfigured('Please give me a display name')
        if self.slug is None:
            self.slug = slugify(self.display_name)
        self.namespace = namespace or self.namespace or self.slug
        if parent is None:
            self.base_riff = self
            self.path = (self,)
        else:
            self.base_riff = parent.base_riff
            self.path = parent.path + (self,)
        self._riffs = SortedDict()
        for riff_class in self.riff_classes:
            self.register(riff_class)

    def __getitem__(self, key):
        return self._riffs[key]

    def sort_riffs(self, key=None, reverse=False):
        if key is None:
            key = lambda r: r.display_name
        riffs = sorted(self._riffs.itervalues(), key=key, reverse=reverse)
        self._riffs.keyOrder = [r.namespace for r in riffs]

    @property

# Path: djam/views/base.py
# class DefaultRedirectView(RedirectView):
#     permanent = False
# 
#     def get_redirect_url(self, **kwargs):
#         return self.riff.get_default_url()


# Path: djam/riffs/base.py
from django.conf.urls import patterns, include, url
from django.core.urlresolvers import reverse
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponseForbidden
from django.template.defaultfilters import slugify
from django.utils.datastructures import SortedDict
from djam.views.base import DefaultRedirectView

    default_redirect_view = DefaultRedirectView
    widget_template = 'djam/_widget.html'

    def __init__(self, parent=None, namespace=None, app_name=None):
        self.parent = parent
        if self.display_name is None:
            raise ImproperlyConfigured('Please give me a display name')
        if self.slug is None:
            self.slug = slugify(self.display_name)
        self.namespace = namespace or self.namespace or self.slug
        if parent is None:
            self.base_riff = self
            self.path = (self,)
        else:
            self.base_riff = parent.base_riff
            self.path = parent.path + (self,)
        self._riffs = SortedDict()
        for riff_class in self.riff_classes:
            self.register(riff_class)

    def __getitem__(self, key):
        return self._riffs[key]

    def sort_riffs(self, key=None, reverse=False):
        if key is None:
            key = lambda r: r.display_name
        riffs = sorted(self._riffs.itervalues(), key=key, reverse=reverse)
        self._riffs.keyOrder = [r.namespace for r in riffs]

    @property

    def riffs(self):