from django.views.generic.list_detail import object_detail

def filtered_object_detail(request, queryset,
        template_name=None, template_name_field=None,
        template_loader=loader, extra_context=None,
        context_processors=None, template_object_name='object',
        mimetype=None, filters=None, **kwargs):
    
    """
    Generic detail of an object derived by filtering a queryset by multiple parameters

    Templates: ``<app_label>/<model_name>_detail.html``
    Context:
        object
            the object
    """
    
    args = {}
    
    for i in range(0, len(kwargs)):
        if 'value' + str(i+1) in kwargs.keys() and len(filters) >= i
            args[filters[i]] = kwargs['value' + str(i+1)]
    
    queryset = queryset.filter(**args)

    if len(queryset) > 0:
        object_id = str(queryset[0].id)
    else:
        object_id = None

    return object_detail(request, queryset, object_id,
        None, None, template_name, template_name_field,
        template_loader, extra_context, context_processors,
        template_object_name, mimetype
    )


urlpattern example:

    url(r'^company/(?P<value1>[a-zA-Z0-9\-\_\.]+)/(?P<value2>[a-zA-Z0-9\-\_\.]+)/$',
        filtered_object_detail,
        {
            "queryset" : Branch.objects.all(),
            'filters': ['company__slug', 'slug'],
        }
    ),